home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / BBS-Archive / Dev / gcc263-diffs.lha / gcc263-diffs
Text File  |  1995-02-06  |  114KB  |  3,397 lines

  1. diff -2rcN gcc-2.6.3/Makefile.in gcc-2.6.3-amiga/Makefile.in
  2. *** gcc-2.6.3/Makefile.in    Mon Nov 28 23:54:06 1994
  3. --- gcc-2.6.3-amiga/Makefile.in    Tue Dec  6 14:21:01 1994
  4. ***************
  5. *** 66,74 ****
  6.   SHELL = /bin/sh
  7.   # on sysV, define this as cp.
  8. ! INSTALL = install -c
  9.   # These permit overriding just for certain files.
  10.   INSTALL_PROGRAM = $(INSTALL)
  11.   INSTALL_DATA = $(INSTALL)
  12. ! SYMLINK = ln -s
  13.   MAKEINFO = makeinfo
  14.   TEXI2DVI = texi2dvi
  15. --- 66,77 ----
  16.   SHELL = /bin/sh
  17.   # on sysV, define this as cp.
  18. ! INSTALL = cp
  19.   # These permit overriding just for certain files.
  20.   INSTALL_PROGRAM = $(INSTALL)
  21.   INSTALL_DATA = $(INSTALL)
  22. ! SYMLINK = cp
  23. ! # Some systems don't support hardlinks.  For this case, a simple copy
  24. ! # will achieve the same results for our purposes.
  25. ! HARDLINK = cp
  26.   MAKEINFO = makeinfo
  27.   TEXI2DVI = texi2dvi
  28. ***************
  29. *** 100,104 ****
  30.   
  31.   # Target to use when installing include directory.  Either
  32. ! # install-headers-tar or install-headers-cpio.
  33.   INSTALL_HEADERS_DIR = install-headers-tar
  34.   
  35. --- 103,107 ----
  36.   
  37.   # Target to use when installing include directory.  Either
  38. ! # install-headers-tar install-headers-cpio, or install-headers-cp.
  39.   INSTALL_HEADERS_DIR = install-headers-tar
  40.   
  41. ***************
  42. *** 106,110 ****
  43.   # Usually the one we just built.
  44.   # Don't use this as a dependency--use $(GCC_PASSES) or $(GCC_PARTS).
  45. ! GCC_FOR_TARGET = ./xgcc -B./
  46.   
  47.   # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
  48. --- 109,114 ----
  49.   # Usually the one we just built.
  50.   # Don't use this as a dependency--use $(GCC_PASSES) or $(GCC_PARTS).
  51. ! XGCC = xgcc
  52. ! GCC_FOR_TARGET = ./$(XGCC) -B./
  53.   
  54.   # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
  55. ***************
  56. *** 151,160 ****
  57.   # Common prefix for installation directories.
  58.   # NOTE: This directory must exist when you start installation.
  59. ! prefix = /usr/local
  60.   # Directory in which to put localized header files. On the systems with
  61.   # gcc as the native cc, `local_prefix' may not be `prefix' which is
  62.   # `/usr'.
  63.   # NOTE: local_prefix *should not* default from prefix.
  64. ! local_prefix = /usr/local
  65.   # Directory in which to put host dependent programs and libraries
  66.   exec_prefix = $(prefix)
  67. --- 155,167 ----
  68.   # Common prefix for installation directories.
  69.   # NOTE: This directory must exist when you start installation.
  70. ! prefix = /gnu
  71.   # Directory in which to put localized header files. On the systems with
  72.   # gcc as the native cc, `local_prefix' may not be `prefix' which is
  73.   # `/usr'.
  74. + # Similar considerations apply for toolkits located on non-writable storage,
  75. + # such as CD-ROM, where we need a completely separate place to put local
  76. + # include files.
  77.   # NOTE: local_prefix *should not* default from prefix.
  78. ! local_prefix = /gnu
  79.   # Directory in which to put host dependent programs and libraries
  80.   exec_prefix = $(prefix)
  81. ***************
  82. *** 622,626 ****
  83.   
  84.   # Dump a specs file to make -B./ read these specs over installed ones.
  85. ! specs: xgcc
  86.       $(GCC_FOR_TARGET) -dumpspecs > specs
  87.   
  88. --- 629,633 ----
  89.   
  90.   # Dump a specs file to make -B./ read these specs over installed ones.
  91. ! specs: xgcc xgccv
  92.       $(GCC_FOR_TARGET) -dumpspecs > specs
  93.   
  94. ***************
  95. *** 839,844 ****
  96.   # message from ar, we make sure all files are writable.
  97.       -(cd tmpcopy; chmod +w * > /dev/null 2>&1)
  98. !     (cd tmpcopy; $(AR) x ../$(LIBGCC2))
  99. !     (cd tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc.a *.o)
  100.       rm -rf tmpcopy
  101.       -if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc.a; else true; fi
  102. --- 846,852 ----
  103.   # message from ar, we make sure all files are writable.
  104.       -(cd tmpcopy; chmod +w * > /dev/null 2>&1)
  105. ! # The "cd..; wait" makes sure that the lock on tmpcopy has time to disappear.
  106. !     (cd tmpcopy; $(AR) x ../$(LIBGCC2); cd ..; /c/wait 2)
  107. !     (cd tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc.a *.o; cd ..; /c/wait 2)
  108.       rm -rf tmpcopy
  109.       -if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc.a; else true; fi
  110. ***************
  111. *** 912,919 ****
  112.       $(MAKE) -f $${srcdir1}/objc/Makefile libobjc.a \
  113.         srcdir=$${srcdir1} tooldir=$(tooldir) AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" \
  114. !       GCC_FOR_TARGET="$${thisdir1}/xgcc -B$${thisdir1}/" \
  115.         GCC_CFLAGS="$(GCC_CFLAGS)"
  116.       -rm -f libobjc.a
  117. !     ln objc/libobjc.a . >/dev/null 2>&1 || cp objc/libobjc.a .
  118.       -if $(RANLIB_TEST) ; then $(RANLIB) libobjc.a; else true; fi
  119.   
  120. --- 920,927 ----
  121.       $(MAKE) -f $${srcdir1}/objc/Makefile libobjc.a \
  122.         srcdir=$${srcdir1} tooldir=$(tooldir) AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" \
  123. !       GCC_FOR_TARGET="$${thisdir1}/$(XGCC) -B$${thisdir1}/" \
  124.         GCC_CFLAGS="$(GCC_CFLAGS)"
  125.       -rm -f libobjc.a
  126. !     $(HARDLINK) objc/libobjc.a . >/dev/null 2>&1 || cp objc/libobjc.a .
  127.       -if $(RANLIB_TEST) ; then $(RANLIB) libobjc.a; else true; fi
  128.   
  129. ***************
  130. *** 925,929 ****
  131.       $(MAKE) -f $$srcdir1/objc/Makefile libobjc.a \
  132.         srcdir=$$srcdir1 tooldir=$(tooldir) AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" \
  133. !       GCC_FOR_TARGET="$$thisdir1/xgcc -B$$thisdir1/" \
  134.         GCC_CFLAGS="$(GCC_CFLAGS)"
  135.   
  136. --- 933,937 ----
  137.       $(MAKE) -f $$srcdir1/objc/Makefile libobjc.a \
  138.         srcdir=$$srcdir1 tooldir=$(tooldir) AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" \
  139. !       GCC_FOR_TARGET="$$thisdir1/$(XGCC) -B$$thisdir1/" \
  140.         GCC_CFLAGS="$(GCC_CFLAGS)"
  141.   
  142. ***************
  143. *** 976,980 ****
  144.   ld: collect2
  145.       rm -f ld
  146. !     ln collect2 ld
  147.   
  148.   collect2 : collect2.o version.o $(LIBDEPS)
  149. --- 984,988 ----
  150.   ld: collect2
  151.       rm -f ld
  152. !     $(HARDLINK) collect2 ld
  153.   
  154.   collect2 : collect2.o version.o $(LIBDEPS)
  155. ***************
  156. *** 1491,1495 ****
  157.   cpp: cccp
  158.       -rm -f cpp
  159. !     ln cccp cpp
  160.   cccp: cccp.o cexp.o version.o $(LIBDEPS)
  161.       $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cccp cccp.o cexp.o version.o $(LIBS)
  162. --- 1499,1503 ----
  163.   cpp: cccp
  164.       -rm -f cpp
  165. !     $(HARDLINK) cccp cpp
  166.   cccp: cccp.o cexp.o version.o $(LIBDEPS)
  167.       $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cccp cccp.o cexp.o version.o $(LIBS)
  168. ***************
  169. *** 1651,1655 ****
  170.       $(MAKE) -f $${srcdir1}/objc/Makefile copy-headers \
  171.       srcdir=$${srcdir1} tooldir=$(tooldir) AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" \
  172. !     GCC_FOR_TARGET="$${thisdir1}/xgcc -B$${thisdir1}/" \
  173.       GCC_CFLAGS="$(GCC_CFLAGS)" incinstalldir=$${thisdir1}/include
  174.       touch objc-headers
  175. --- 1659,1663 ----
  176.       $(MAKE) -f $${srcdir1}/objc/Makefile copy-headers \
  177.       srcdir=$${srcdir1} tooldir=$(tooldir) AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" \
  178. !     GCC_FOR_TARGET="$${thisdir1}/$(XGCC) -B$${thisdir1}/" \
  179.       GCC_CFLAGS="$(GCC_CFLAGS)" incinstalldir=$${thisdir1}/include
  180.       touch objc-headers
  181. ***************
  182. *** 1832,1835 ****
  183. --- 1840,1844 ----
  184.       -rm -fr stage1 stage2 stage3 stage4
  185.       -rm -f */stage1 */stage2 */stage3 */stage4 */include
  186. +     -rm -f cp-parse.output
  187.       -rm -f objc-parse.output
  188.       -rm -f c-parse.output
  189. ***************
  190. *** 2031,2035 ****
  191.           if expr "$$dest" : "$$dir.*" > /dev/null; then \
  192.             rm -f $(libsubdir)/include/$$i; \
  193. !           ln -s `echo $$i | sed "s|/[^/]*|/..|g" | sed 's|/..$$||'``echo "$$dest" | sed "s|$$dir||"` $(libsubdir)/include/$$i; \
  194.           fi; \
  195.         done; \
  196. --- 2040,2044 ----
  197.           if expr "$$dest" : "$$dir.*" > /dev/null; then \
  198.             rm -f $(libsubdir)/include/$$i; \
  199. !           $(HARDLINK) -s `echo $$i | sed "s|/[^/]*|/..|g" | sed 's|/..$$||'``echo "$$dest" | sed "s|$$dir||"` $(libsubdir)/include/$$i; \
  200.           fi; \
  201.         done; \
  202. ***************
  203. *** 2054,2057 ****
  204. --- 2063,2070 ----
  205.       (cd include; find . -print) | (cd include; cpio -pdum $(libsubdir)/include)
  206.   
  207. + # Install the include directory using simple recursive copy.
  208. + install-headers-cp: stmp-headers install-include-dir
  209. +     cd include; cp -r . $(libsubdir)/include
  210.   # Put assert.h where it won't override GNU libc's assert.h.
  211.   # It goes in a dir that is searched after GNU libc's headers;
  212. ***************
  213. *** 2143,2147 ****
  214.       mkdir tmp/objc
  215.       for file in *[0-9a-zA-Z+]; do \
  216. !       ln $$file tmp > /dev/null 2>&1 || cp $$file tmp; \
  217.       done
  218.       cd config; \
  219. --- 2156,2160 ----
  220.       mkdir tmp/objc
  221.       for file in *[0-9a-zA-Z+]; do \
  222. !       $(HARDLINK) $$file tmp > /dev/null 2>&1 || cp $$file tmp; \
  223.       done
  224.       cd config; \
  225. ***************
  226. *** 2151,2160 ****
  227.           cd $$file; \
  228.           for subfile in *[0-9a-zA-Z+]; do \
  229. !           ln $$subfile ../../tmp/config/$$file >/dev/null 2>&1 \
  230.             || cp $$subfile ../../tmp/config/$$file; \
  231.           done; \
  232.           cd ..; \
  233.         else \
  234. !         ln $$file ../tmp/config >/dev/null 2>&1 \
  235.           || cp $$file ../tmp/config; \
  236.         fi; \
  237. --- 2164,2173 ----
  238.           cd $$file; \
  239.           for subfile in *[0-9a-zA-Z+]; do \
  240. !           $(HARDLINK) $$subfile ../../tmp/config/$$file >/dev/null 2>&1 \
  241.             || cp $$subfile ../../tmp/config/$$file; \
  242.           done; \
  243.           cd ..; \
  244.         else \
  245. !         $(HARDLINK) $$file ../tmp/config >/dev/null 2>&1 \
  246.           || cp $$file ../tmp/config; \
  247.         fi; \
  248. ***************
  249. *** 2166,2172 ****
  250.       cd objc; \
  251.       for file in *[0-9a-zA-Z+]; do \
  252. !       ln $$file ../tmp/objc >/dev/null 2>&1 || cp $$file ../tmp/objc; \
  253.       done
  254. !     ln .gdbinit tmp
  255.   
  256.   # Finish making `distdir', after the languages have done their thing.
  257. --- 2179,2185 ----
  258.       cd objc; \
  259.       for file in *[0-9a-zA-Z+]; do \
  260. !       $(HARDLINK) $$file ../tmp/objc >/dev/null 2>&1 || cp $$file ../tmp/objc; \
  261.       done
  262. !     $(HARDLINK) .gdbinit tmp
  263.   
  264.   # Finish making `distdir', after the languages have done their thing.
  265. ***************
  266. *** 2196,2210 ****
  267.   # THIS IS OBSOLETE; use the -srcdir operand in configure instead. 
  268.   maketest:
  269. !     ln -s $(DIR)/*.[chy] .
  270. !     ln -s $(DIR)/configure .
  271. !     ln -s $(DIR)/*.def .
  272.       -rm -f =*
  273. !     ln -s $(DIR)/.gdbinit .
  274. !     ln -s $(DIR)/$(FIXINCLUDES) .
  275. !     -ln -s $(DIR)/bison.simple .
  276. !     ln -s $(DIR)/config .
  277. !     ln -s $(DIR)/move-if-change .
  278.   # The then and else were swapped to avoid a problem on Ultrix.
  279. !     if [ ! -f Makefile ] ; then ln -s $(DIR)/Makefile .; else false; fi
  280.       -rm tm.h aux-output.c config.h md
  281.       make clean
  282. --- 2209,2223 ----
  283.   # THIS IS OBSOLETE; use the -srcdir operand in configure instead. 
  284.   maketest:
  285. !     $(SYMLINK) $(DIR)/*.[chy] .
  286. !     $(SYMLINK) $(DIR)/configure .
  287. !     $(SYMLINK) $(DIR)/*.def .
  288.       -rm -f =*
  289. !     $(SYMLINK) $(DIR)/.gdbinit .
  290. !     $(SYMLINK) $(DIR)/$(FIXINCLUDES) .
  291. !     -$(SYMLINK) $(DIR)/bison.simple .
  292. !     $(SYMLINK) $(DIR)/config .
  293. !     $(SYMLINK) $(DIR)/move-if-change .
  294.   # The then and else were swapped to avoid a problem on Ultrix.
  295. !     if [ ! -f Makefile ] ; then $(SYMLINK) $(DIR)/Makefile .; else false; fi
  296.       -rm tm.h aux-output.c config.h md
  297.       make clean
  298. ***************
  299. *** 2222,2236 ****
  300.   # because alloca.o is newer, we permit these recursive makes to compile
  301.   # alloca.o.  Then cc1 is newer, so it won't have to be relinked.
  302. !     $(MAKE) CC="stage1/xgcc -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
  303.       $(MAKE) stage2
  304. !     $(MAKE) CC="stage2/xgcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
  305.   
  306.   bootstrap2: force
  307. !     $(MAKE) CC="stage1/xgcc -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
  308.       $(MAKE) stage2
  309. !     $(MAKE) CC="stage2/xgcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
  310.   
  311.   bootstrap3: force
  312. !     $(MAKE) CC="stage2/xgcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
  313.   
  314.   # Compare the object files in the current directory with those in the
  315. --- 2235,2249 ----
  316.   # because alloca.o is newer, we permit these recursive makes to compile
  317.   # alloca.o.  Then cc1 is newer, so it won't have to be relinked.
  318. !     $(MAKE) CC="stage1/$(XGCC) -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
  319.       $(MAKE) stage2
  320. !     $(MAKE) CC="stage2/$(XGCC) -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
  321.   
  322.   bootstrap2: force
  323. !     $(MAKE) CC="stage1/$(XGCC) -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
  324.       $(MAKE) stage2
  325. !     $(MAKE) CC="stage2/$(XGCC) -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
  326.   
  327.   bootstrap3: force
  328. !     $(MAKE) CC="stage2/$(XGCC) -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
  329.   
  330.   # Compare the object files in the current directory with those in the
  331. ***************
  332. *** 2307,2311 ****
  333.       -for dir in . $(SUBDIRS) ; \
  334.        do \
  335. !        if [ -d stage1/$$dir ] ; then true ; else mkdir stage1/$$dir ; fi ; \
  336.        done
  337.       -mv $(STAGESTUFF) stage1
  338. --- 2320,2324 ----
  339.       -for dir in . $(SUBDIRS) ; \
  340.        do \
  341. !        if [ -d stage1/$$dir ] ; then true ; else mkdir stage1/$$dir ; fi; \
  342.        done
  343.       -mv $(STAGESTUFF) stage1
  344. ***************
  345. *** 2319,2323 ****
  346.       -for dir in . $(SUBDIRS) ; \
  347.        do \
  348. !        if [ -d stage2/$$dir ] ; then true ; else mkdir stage2/$$dir ; fi ; \
  349.        done
  350.       -mv $(STAGESTUFF) stage2
  351. --- 2332,2336 ----
  352.       -for dir in . $(SUBDIRS) ; \
  353.        do \
  354. !        if [ -d stage2/$$dir ] ; then true ; else mkdir stage2/$$dir ; fi; \
  355.        done
  356.       -mv $(STAGESTUFF) stage2
  357. ***************
  358. *** 2331,2335 ****
  359.       -for dir in . $(SUBDIRS) ; \
  360.        do \
  361. !        if [ -d stage3/$$dir ] ; then true ; else mkdir stage3/$$dir ; fi ; \
  362.        done
  363.       -mv $(STAGESTUFF) stage3
  364. --- 2344,2348 ----
  365.       -for dir in . $(SUBDIRS) ; \
  366.        do \
  367. !        if [ -d stage3/$$dir ] ; then true ; else mkdir stage3/$$dir ; fi; \
  368.        done
  369.       -mv $(STAGESTUFF) stage3
  370. ***************
  371. *** 2343,2347 ****
  372.       -for dir in . $(SUBDIRS) ; \
  373.        do \
  374. !        if [ -d stage4/$$dir ] ; then true ; else mkdir stage4/$$dir ; fi ; \
  375.        done
  376.       -mv $(STAGESTUFF) stage4
  377. --- 2356,2360 ----
  378.       -for dir in . $(SUBDIRS) ; \
  379.        do \
  380. !        if [ -d stage4/$$dir ] ; then true ; else mkdir stage4/$$dir ; fi; \
  381.        done
  382.       -mv $(STAGESTUFF) stage4
  383. diff -2rcN gcc-2.6.3/amigasup.c gcc-2.6.3-amiga/amigasup.c
  384. *** gcc-2.6.3/amigasup.c
  385. --- gcc-2.6.3-amiga/amigasup.c    Tue Dec 27 10:48:14 1994
  386. ***************
  387. *** 0 ****
  388. --- 1,172 ----
  389. + /* Supplimentary host support for AmigaDOS.  Used only when host is AmigaDOS.
  390. +    Copyright (C) 1994 Free Software Foundation, Inc.
  391. + This file is part of GNU CC.
  392. + GNU CC is free software; you can redistribute it and/or modify
  393. + it under the terms of the GNU General Public License as published by
  394. + the Free Software Foundation; either version 2, or (at your option)
  395. + any later version.
  396. + GNU CC is distributed in the hope that it will be useful,
  397. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  398. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  399. + GNU General Public License for more details.
  400. + You should have received a copy of the GNU General Public License
  401. + along with GNU CC; see the file COPYING.  If not, write to
  402. + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  403. + This code segment will interface between the startup code and the user's
  404. + main(), adjusting the stack if necessary. Two entry points are provided,
  405. + main(), and stkexit(). Programs should be compiled using
  406. +     gcc -Dmain=stkmain -Dexit=stkexit
  407. + and linked with this module.  Calling _exit is not provided for, but should
  408. + be trivial to implement.
  409. + The minimum acceptable stack size is obtained from the environment variable
  410. + GCCSTACK (change the #define ENVNAME to customize). If this variable is
  411. + not defined, the default is 50000 bytes (change the #define SIZE to
  412. + customize). If the current stack size is less than the minimum acceptable,
  413. + then a new stack is allocated, and appropriate actions are taken to ensure
  414. + that the original stack is restored before exit.
  415. + To link with my stderrfix hack, you will need to compile it using
  416. +        gcc -Dmain=stkmain -c stderrfix.c
  417. + and compile everything else (apart from this file) using
  418. +        gcc -Dmain=mymain -Dexit=stkexit
  419. + (I have not tested this, but there is no reason why it shouldn't work.)
  420. + AUTHOR:     Kriton Kyrimis (kyrimis@theseas.ntua.gr)
  421. + KNOWN BUGS: Calling stkexit(0x8000000) will cause the program to exit
  422. +             with the wrong exit code (0).
  423. + DISCLAIMER: Use this code at your own risk.
  424. + */
  425. + /* Putting this in version.c seems to screw up configure, which attempts to
  426. +    extract the version number with a sed command that doesn't take this
  427. +    string into account. -fnf */
  428. + char VERSION[]="$VER:gcc 2.6.3 last compiled on "__DATE__;
  429. + #include <stdlib.h>
  430. + #include <setjmp.h>
  431. + #include <dos/dosextens.h>
  432. + #include <proto/exec.h>
  433. + #include <proto/dos.h>
  434. + /* Phil.B: 03-Oct-94 Flag indicating process priority */
  435. + static int amiga_priority = -1;
  436. + #define SIZE 50000
  437. + #define ENVNAME "GCCSTACK"
  438. + #define MAGIC 0x80000000
  439. + void stkexit(int);
  440. + static jmp_buf jmp;
  441. + static int swapped = 0;
  442. + main(int argc, char **argv)
  443. + {
  444. +   /* Declare all variables as static, so that they are available no matter
  445. +      which stack is active */
  446. +   static struct Process *p;
  447. +   static struct CommandLineInterface *c;
  448. +   static int stacksize, prefsize, status;
  449. +   static struct StackSwapStruct stack;
  450. +   static char *envsize, *newstack, *envpri;
  451. +   /* The next two variables point to information in the old stack. Declare
  452. +      them volatile, to avoid unexpected surprises introduced by the optimizer.
  453. +      (This is apparently unnecessary under 2.6.1, but you never know.) */
  454. +   static volatile int myargc;
  455. +   static volatile char **myargv;
  456. +   /* Determine original stack size */
  457. +   p = (struct Process *)FindTask(NULL);
  458. +   c = BADDR(p->pr_CLI);
  459. +   if (c) {
  460. +     stacksize = c->cli_DefaultStack * sizeof(LONG);
  461. +   }else{
  462. +     stacksize = p->pr_StackSize;
  463. +   }
  464. +   /* Determine preferred stack size */
  465. +   envsize = getenv(ENVNAME);
  466. +   if (envsize) {
  467. +     prefsize = atoi(envsize);
  468. +   } else {
  469. +     prefsize = SIZE;
  470. +   }
  471. +   if (envpri = getenv("GCCPRIORITY"))
  472. +     if (((i = atoi(envpri)) > -20) && (i < 20)) amiga_priority = i;
  473. +   SetTaskPri(p, amiga_priority);
  474. +   myargc = argc;
  475. +   myargv = argv;
  476. +   if (prefsize > stacksize) {
  477. +     /* Round size to next long word */
  478. +     prefsize = ((prefsize + (sizeof(LONG) - 1)) / sizeof(LONG)) * sizeof(LONG);
  479. +     /* Allocate new stack */
  480. +     newstack = malloc(prefsize);
  481. +     if (!newstack) {
  482. +       Printf("Can't allocate new stack!\n");
  483. +       exit(RETURN_FAIL);
  484. +     }
  485. +     /* Build new stack structure */
  486. +     stack.stk_Lower = newstack;
  487. +     stack.stk_Upper = (ULONG)newstack + prefsize;
  488. +     /* Determine the address the stackpointer has to go:
  489. +      * Point to the last longword of the stackframe and subtract
  490. +      * the arguments of StackSwap() since the compiler might
  491. +      * try to adjust the stackpointer after calling it :-(.
  492. +      */
  493. +     stack.stk_Pointer = (APTR)(stack.stk_Upper-2*sizeof(long));
  494. +     /* Switch to new stack */
  495. +     StackSwap(&stack);
  496. +     swapped = 1;
  497. +     if (c) {
  498. +       c->cli_DefaultStack = prefsize / sizeof(LONG);
  499. +     }
  500. +     /* Save the current position, so that on exit we may return to the exact
  501. +        stack depth where we switched stacks, and switch them back again.
  502. +        Programs should invoke stkexit() rather than exit(), or return from
  503. +        stkmain(). Status contains the exit status given to stkexit().*/
  504. +     if ((status = setjmp(jmp)) != 0) {
  505. +       /* Switch back to old stack before exiting */
  506. +       StackSwap(&stack);
  507. +       if (c) {
  508. +     c->cli_DefaultStack = stacksize / sizeof(LONG);
  509. +       }
  510. +       free(newstack);
  511. +       if (status == MAGIC) {    /* If real exit status is 0, stkexit converts */
  512. +         status = 0;        /* it to MAGIC, to avoid confusing setjmp */
  513. +       }
  514. +       exit(status);
  515. +     }
  516. +     status = stkmain(myargc, myargv);
  517. +     stkexit(status);
  518. +   }else{
  519. +     return stkmain(myargc, myargv);
  520. +   }
  521. + }
  522. + void
  523. + stkexit(int status)
  524. + {
  525. +   if (!swapped) {
  526. +     exit (status);
  527. +   }else{
  528. +     if (status == 0) {    /* The world will end iff we pass 0 as the value */
  529. +       status = MAGIC;    /* for longjmp */
  530. +     }
  531. +     longjmp(jmp, status);
  532. +   }
  533. + }
  534. diff -2rcN gcc-2.6.3/cccp.c gcc-2.6.3-amiga/cccp.c
  535. *** gcc-2.6.3/cccp.c    Fri Nov 18 23:54:36 1994
  536. --- gcc-2.6.3-amiga/cccp.c    Tue Dec 27 10:33:44 1994
  537. ***************
  538. *** 40,43 ****
  539. --- 40,59 ----
  540.   #endif /* not EMACS */
  541.   
  542. + #ifdef amigados
  543. + /* Since cpp uses alloca to store all its read files, this is quite deadly
  544. +    on a system with non-automatic stackgrowth like amigados, so we better
  545. +    turn it off now.  Normally alloca is #defined to __builtin_alloca, so
  546. +    undefining it causes an external alloca to be used.
  547. +    Note that it's not wise to generally inhibit __builtin_alloca, since
  548. +    using the generic emulator entitels a serious (!) speed penalty, and
  549. +    it's bad enough that we have to live with it in cccp, don't make cc1
  550. +    unbearably slow as well... */
  551. + #undef alloca
  552. + static int amigados_abs_filename ();
  553. + #endif
  554.   #ifndef STANDARD_INCLUDE_DIR
  555.   #define STANDARD_INCLUDE_DIR "/usr/include"
  556. ***************
  557. *** 366,369 ****
  558. --- 382,392 ----
  559.   static int max_include_len;
  560.   
  561. + #ifdef amigados
  562. + /* Phil.B: 03-Oct-94 Flag indicating process priority */
  563. + static int amiga_priority = -1;
  564. + #include <proto/exec.h>
  565. + struct Task *amiga_task;
  566. + #endif /* amigados */
  567.   /* Nonzero means turn NOTREACHED into #pragma NOTREACHED etc */
  568.   
  569. ***************
  570. *** 1132,1135 ****
  571. --- 1155,1167 ----
  572.   #endif /* RLIMIT_STACK defined */
  573.   
  574. + #ifdef amigados
  575. +   {
  576. +     char *envstr;
  577. +     if (envstr = getenv("GCCPRIORITY"))
  578. +       if (((i = atoi(envstr)) > -20) && (i < 20)) amiga_priority = i;
  579. +   }
  580. + #endif /* amigados */
  581.   #ifdef SIGPIPE
  582.     signal (SIGPIPE, pipe_closed);
  583. ***************
  584. *** 1338,1341 ****
  585. --- 1370,1383 ----
  586.   
  587.         case 'p':
  588. + #ifdef amigados
  589. +     if (!strcmp (argv[i], "-priority")) {
  590. +       if (i + 1 == argc)
  591. +         fatal ("Priority missing after -P option");
  592. +           if ((amiga_priority = atoi(argv[++i])) < -25)
  593. +         amiga_priority = -25;
  594. +           else if (amiga_priority > 25)
  595. +         amiga_priority = 25;
  596. +         } else
  597. + #endif /* amigados */
  598.       if (!strcmp (argv[i], "-pedantic"))
  599.         pedantic = 1;
  600. ***************
  601. *** 1627,1630 ****
  602. --- 1669,1679 ----
  603.     }
  604.   
  605. + #ifdef amigados
  606. +   Forbid();
  607. +   amiga_task = FindTask(NULL);
  608. +   Permit();
  609. +   SetTaskPri(amiga_task, amiga_priority);
  610. + #endif /* amigados */
  611.     /* Add dirs from CPATH after dirs from -I.  */
  612.     /* There seems to be confusion about what CPATH should do,
  613. ***************
  614. *** 1989,1992 ****
  615. --- 2038,2044 ----
  616.   
  617.         /* Discard all directory prefixes from filename.  */
  618. + #ifdef FILE_NAME_NONDIRECTORY
  619. +       q = FILE_NAME_NONDIRECTORY (in_fname);
  620. + #else
  621.         if ((q = rindex (in_fname, '/')) != NULL
  622.   #ifdef DIR_SEPARATOR
  623. ***************
  624. *** 1997,2001 ****
  625.         else
  626.       q = in_fname;
  627.         /* Copy remainder to mungable area.  */
  628.         p = (char *) alloca (strlen(q) + 8);
  629. --- 2049,2053 ----
  630.         else
  631.       q = in_fname;
  632. ! #endif
  633.         /* Copy remainder to mungable area.  */
  634.         p = (char *) alloca (strlen(q) + 8);
  635. ***************
  636. *** 3795,3799 ****
  637. --- 3847,3856 ----
  638.         if (!no_output && already_output == 0
  639.         && (kt->pass_thru
  640. + /* Phil.B 27-Mar-93 not quiet sure to keep this old fix */      
  641. + #ifdef maybe_amigados
  642. +           || ((kt->type == T_DEFINE || kt->type == T_UNDEF)
  643. + #else
  644.             || (kt->type == T_DEFINE
  645. + #endif /* amigados */
  646.             && (dump_macros == dump_names
  647.                 || dump_macros == dump_definitions)))) {
  648. ***************
  649. *** 4137,4140 ****
  650. --- 4194,4209 ----
  651.   #ifndef VMS
  652.           ep = rindex (nam, '/');
  653. + #ifdef amigados
  654. +         /* amigados uses unix-style directory-filename separation, but
  655. +            has VMS-style logicals as well */
  656. +         if (ep == NULL) 
  657. +           {
  658. +         ep = rindex (nam, ':');
  659. +         /* a ':' is part of the directory name, a '/' isn't ! */
  660. +             if (ep != NULL) ep++;
  661. +           }
  662. + #endif /* amigados */
  663.   #else                /* VMS */
  664.           ep = rindex (nam, ']');
  665. ***************
  666. *** 4238,4242 ****
  667. --- 4307,4315 ----
  668.     /* If specified file name is absolute, just open it.  */
  669.   
  670. + #ifndef amigados
  671.     if (*fbeg == '/') {
  672. + #else
  673. +   if (amigados_abs_filename (fbeg, flen)) {
  674. + #endif
  675.       strncpy (fname, fbeg, flen);
  676.       fname[flen] = 0;
  677. ***************
  678. *** 4261,4264 ****
  679. --- 4334,4341 ----
  680.         continue;
  681.       strcpy (fname, searchptr->fname);
  682. + #ifdef amigados
  683. +     if (fname[strlen (fname) - 1] != ':')
  684. + #endif
  685.       strcat (fname, "/");
  686.       fname[strlen (fname) + flen] = 0;
  687. ***************
  688. *** 9978,9979 ****
  689. --- 10055,10080 ----
  690.   }
  691.   #endif /* VMS */
  692. + #ifdef amigados
  693. + /* This function returns whether the LEN characters long filename FNAME 
  694. +    is an absolute path specification. */
  695. + static int
  696. + amigados_abs_filename (fname, len)
  697. +      char *fname;
  698. +      int len;
  699. + {
  700. +   /* we're using ixemul.library, which treats `/foo' as `foo:', so 
  701. +      fname[0] is to be considered absolute as well */
  702. +   if (fname[0] == '/')
  703. +     return 1;
  704. +   /* else do an index() on fname, but one which is limited to len characters */
  705. +   while (*fname && *fname != ':' && len) 
  706. +     fname++, len--;
  707. +   return *fname == ':';
  708. + }
  709. + #endif /* amigados */
  710. diff -2rcN gcc-2.6.3/config/m68k/amigados.c gcc-2.6.3-amiga/config/m68k/amigados.c
  711. *** gcc-2.6.3/config/m68k/amigados.c
  712. --- gcc-2.6.3-amiga/config/m68k/amigados.c    Tue Dec  6 14:21:03 1994
  713. ***************
  714. *** 0 ****
  715. --- 1,158 ----
  716. + /* Definitions of target machine for GNU compiler.  amiga 68000/68020 version.
  717. +    Copyright (C) 1992 Free Software Foundation, Inc.
  718. +    Contributed by Markus M. Wild (wild@amiga.physik.unizh.ch).
  719. + This file is part of GNU CC.
  720. + GNU CC is free software; you can redistribute it and/or modify
  721. + it under the terms of the GNU General Public License as published by
  722. + the Free Software Foundation; either version 2, or (at your option)
  723. + any later version.
  724. + GNU CC is distributed in the hope that it will be useful,
  725. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  726. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  727. + GNU General Public License for more details.
  728. + You should have received a copy of the GNU General Public License
  729. + along with GNU CC; see the file COPYING.  If not, write to
  730. + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  731. + #include "m68k/m68k.c"
  732. + /* Does operand (which is a symbolic_operand) live in text space? If
  733. +    so SYMBOL_REF_FLAG, which is set by ENCODE_SECTION_INFO, will be true.
  734. +    This function is used in base relative code generation. */
  735. + int
  736. + read_only_operand (operand)
  737. +      rtx operand;
  738. + {
  739. +   if (GET_CODE (operand) == CONST)
  740. +     operand = XEXP (XEXP (operand, 0), 0);
  741. +   if (GET_CODE (operand) == SYMBOL_REF)
  742. +     return SYMBOL_REF_FLAG (operand) || CONSTANT_POOL_ADDRESS_P (operand);
  743. +   return 1;
  744. + }
  745. + /* the rest of the file is to implement AmigaDOS specific keywords some day.
  746. +    The approach used so far used __attribute__ for this, but this required
  747. +    changes to c-parse.y as well as if we'd use the common keywords used
  748. +    on commercial AmigaDOS C-compilers as well. So in the future I'll probably
  749. +    switch to __saveds and __interrupt keywords as well.
  750. +    The rest of this file is currently ignored, because it's no longer
  751. +    working with the current gcc version. */
  752. + #if not_yet_working
  753. + #include "tree.h"
  754. + struct attribute {
  755. +   tree ident;
  756. +   int  saveds : 1,
  757. +        interrupt : 1;
  758. + };
  759. + static struct attribute *a_tab = 0;
  760. + static int a_index, a_size;
  761. + void
  762. + add_attr_entry (attr)
  763. +     struct attribute *attr;
  764. + {
  765. +   if (! a_tab)
  766. +     {
  767. +       a_size = 10;
  768. +       a_index = 0;
  769. +       a_tab  = (struct attribute *) xmalloc (a_size * sizeof (struct attribute));
  770. +     }
  771. +   if (a_index == a_size)
  772. +     {
  773. +       a_size <<= 1;
  774. +       a_tab = (struct attribute *) xrealloc (a_tab, a_size * sizeof (struct attribute));
  775. +     }
  776. +   a_tab[a_index++] = *attr;
  777. + }
  778. + void
  779. + attr_do_saveds (function_ident)
  780. +       tree function_ident;
  781. + {
  782. +   struct attribute attr, *a;
  783. +   int i;
  784. +   for (i = 0, a = a_tab; i < a_index; i++, a++)
  785. +     if (a->ident == function_ident)
  786. +       {
  787. +     a->saveds = 1;
  788. +     return;
  789. +       }
  790. +   /* create a new entry for this function */
  791. +   attr.ident     = function_ident;
  792. +   attr.saveds    = 1;
  793. +   attr.interrupt = 0;
  794. +   add_attr_entry (&attr);
  795. + }
  796. + void
  797. + attr_do_interrupt (function_ident)
  798. +     tree function_ident;
  799. + {
  800. +   struct attribute attr, *a;
  801. +   int i;
  802. +   for (i = 0, a = a_tab; i < a_index; i++, a++)
  803. +     if (a->ident == function_ident)
  804. +       {
  805. +     /* __interrupt implies __saveds */
  806. +     a->saveds    = 1;
  807. +     a->interrupt = 1;
  808. +     return;
  809. +       }
  810. +   /* create a new entry for this function */
  811. +   attr.ident     = function_ident;
  812. +   attr.saveds     = 1;
  813. +   attr.interrupt = 1;
  814. +   add_attr_entry (&attr);
  815. + }
  816. + int
  817. + attr_does_saveds (function_name)
  818. +     char *function_name;
  819. + {
  820. +   tree ident = get_identifier (function_name);
  821. +   struct attribute *attr;
  822. +   int i;
  823. +   
  824. +   for (i = 0, attr = a_tab; i < a_index; i++, attr++)
  825. +     if (attr->ident == ident)
  826. +       return attr->saveds;
  827. +   return 0;
  828. + }
  829. + int
  830. + attr_does_interrupt (function_name)
  831. +     char *function_name;
  832. + {
  833. +   tree ident = get_identifier (function_name);
  834. +   struct attribute *attr;
  835. +   int i;
  836. +   
  837. +   for (i = 0, attr = a_tab; i < a_index; i++, attr++)
  838. +     if (attr->ident == ident)
  839. +       return attr->interrupt;
  840. +   return 0;
  841. + }
  842. + #endif
  843. diff -2rcN gcc-2.6.3/config/m68k/amigados.h gcc-2.6.3-amiga/config/m68k/amigados.h
  844. *** gcc-2.6.3/config/m68k/amigados.h
  845. --- gcc-2.6.3-amiga/config/m68k/amigados.h    Tue Dec 27 10:34:42 1994
  846. ***************
  847. *** 0 ****
  848. --- 1,425 ----
  849. + /* Definitions of target machine for GNU compiler.  amiga 68000/68020 version.
  850. +    Copyright (C) 1992 Free Software Foundation, Inc.
  851. +    Contributed by Markus M. Wild (wild@amiga.physik.unizh.ch).
  852. + This file is part of GNU CC.
  853. + GNU CC is free software; you can redistribute it and/or modify
  854. + it under the terms of the GNU General Public License as published by
  855. + the Free Software Foundation; either version 2, or (at your option)
  856. + any later version.
  857. + GNU CC is distributed in the hope that it will be useful,
  858. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  859. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  860. + GNU General Public License for more details.
  861. + You should have received a copy of the GNU General Public License
  862. + along with GNU CC; see the file COPYING.  If not, write to
  863. + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  864. + #include "m68k/m68k.h"
  865. + /* See m68k.h for bits in TARGET_DEFAULT.
  866. +    0 means 68000, no hardware fpu (68881/68882/68040).
  867. +    7 means 68020 (or higher) with hardware fpu.  */
  868. + #ifndef TARGET_DEFAULT
  869. + #define TARGET_DEFAULT 0
  870. + #endif
  871. + /* Define __HAVE_68881__ in preprocessor according to the -m flags.
  872. +    This will control the use of inline 68881 insns in certain macros.
  873. +    Also inform the program which CPU this is for.  */
  874. + #if TARGET_DEFAULT & 02
  875. + /* -m68881 is the default */
  876. + #define CPP_SPEC \
  877. + "%{!msoft-float:-D__HAVE_68881__ }\
  878. + %{!ansi:%{m68000:-Dmc68010}%{mc68000:-Dmc68010}%{m68030:-Dmc68030}%{mc68030:-Dmc68030}%{m68040:-Dmc68040}\
  879. + %{mc68040:-Dmc68040}%{!mc68000:%{!m68000:-Dmc68020}}}"
  880. + #else
  881. + /* -msoft-float is the default, assume -mc68000 as well */
  882. + #define CPP_SPEC \
  883. + "%{m68881:-D__HAVE_68881__ }\
  884. + %{!ansi:%{m68020:-Dmc68020}%{mc68020:-Dmc68020}%{m68030:-Dmc68030}%{mc68030:-Dmc68030}%{m68040:-Dmc68040}\
  885. + %{mc68040:-Dmc68040}%{!mc68020:%{!m68020:%{!mc68030:%{!m68030:%{!mc68040:%{!m68040:-Dmc68010}}}}}}}"
  886. + /* Don't try using XFmode since we don't have appropriate runtime software
  887. +    support.  */
  888. + #undef LONG_DOUBLE_TYPE_SIZE
  889. + #define LONG_DOUBLE_TYPE_SIZE 64
  890. + #endif
  891. + /* -m68000 requires special flags to the assembler.  */
  892. + #if TARGET_DEFAULT & 01
  893. + #define ASM_SPEC \
  894. +  "%{m68000:-mc68010}%{mc68000:-mc68010}%{mc68030:-mc68030}%{m68030:-mc68030}%{mc68040:-mc68040}%{m68040:-mc68040}\
  895. + %{!mc68000:%{!m68000:%{!mc68030:%{!m68030:%{!mc68040:%{!m68040:-mc68020}}}}}} %{msmall-code:-l}"
  896. + #else
  897. + #define ASM_SPEC \
  898. +  "%{m68020:-mc68020}%{mc68020:-mc68020}%{mc68030:-mc68030}%{m68030:-mc68030}%{mc68040:-mc68040}\
  899. + %{m68040:-mc68040}%{!mc68020:%{!m68020:%{!mc68030:%{!m68030:%{!mc68040:%{!m68040:-mc68010}}}}}} %{msmall-code:-l}"
  900. + #endif
  901. + /* amiga/amigados are the new "standard" defines for the Amiga, MCH_AMIGA
  902. +  * was used before and is included for compatibility reasons */
  903. + #define CPP_PREDEFINES "-Dmc68000 -Damiga -Damigados -DMCH_AMIGA -DAMIGA"
  904. + /* Choose the right startup file, depending on whether we use base relative
  905. +    code, base relative code with automatic relocation (-resident), or plain
  906. +    crt0.o. 
  907. +   
  908. +    Profiling is currently only available for plain startup.
  909. +    mcrt0.o does not (yet) exist. */
  910. + #define STARTFILE_SPEC \
  911. +  "%{!noixemul:%{resident:rcrt0.o%s}%{!resident:%{!fbaserel:%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}\
  912. + %{fbaserel:%{pg:bgcrt0.o%s}%{!pg:%{p:bmcrt0.o%s}%{!p:bcrt0.o%s}}}}}\
  913. + %{noixemul:%{resident:libnix/nrcrt0.o%s}%{!resident:%{fbaserel:libnix/nbcrt0.o%s}%{!fbaserel:libnix/ncrt0.o%s}}}"
  914. + #define ENDFILE_SPEC "%{noixemul:-lstubs}"
  915. + /* Automatically search libamiga.a for AmigaDOS specific functions.  Note
  916. +    that we first search the standard C library to resolve as much as
  917. +    possible from there, since it has names that are duplicated in libamiga.a
  918. +    which we *don't* want from there.  Then search the standard C library
  919. +    again to resolve any references that libamiga.a might have generated.
  920. +    This may only be a temporary solution since it might be better to simply
  921. +    remove the things from libamiga.a that should be pulled in from libc.a
  922. +    instead, which would eliminate the first reference to libc.a. */
  923. + #define LIB_SPEC "%{!noixemul:%{!p:%{!pg:-lc -lamiga -lc}}%{p:-lc_p}%{pg:-lc_p}}%{noixemul:-lnixmain -lnix -lamiga}"
  924. + /* if debugging, tell the linker to output amiga-hunk symbols *and* a BSD
  925. +    compatible debug hunk (which will probably change in the future, it's not
  926. +    tremendously useful in its current state). */
  927. + #define LINK_SPEC "%{noixemul:-shortdata -fl libnix} %{fbaserel:%{!resident:-databss-together -fl libb}}\
  928. + %{resident:-databss-together -datadata-reloc -fl libb} %{g:-amiga-debug-hunk}\
  929. + %{m68020:-fl libm020} %{m68030:-fl libm020} %{m68040:-fl libm020}"
  930. + #define CC1_SPEC "%{m68040:-mbitfield }%{mc68040:-mbitfield }%{resident:-fbaserel}%{msmall-code:-fno-function-cse} "
  931. + #define CC1PLUS_SPEC "%{m68040:-mbitfield }%{mc68040:-mbitfield }%{resident:-fbaserel}%{msmall-code:-fno-function-cse} "
  932. + /* Omit frame pointer at high optimization levels. (This doesn't hurt, since
  933. +    GDB doesn't work under AmigaDOS at the moment anyway..) */
  934. +   
  935. + #define OPTIMIZATION_OPTIONS(OPTIMIZE) \
  936. + {                                  \
  937. +   if (OPTIMIZE >= 2)                         \
  938. +     flag_omit_frame_pointer = 1;                \
  939. + }
  940. + /* provide a dummy entry for the small-code switch. This is currently only
  941. +    needed by the assembler (explanations: m68k.h), but will be used by cc1
  942. +    to output 16bit pc-relative code later. */
  943. + #undef TARGET_SWITCHES
  944. + #define TARGET_SWITCHES  \
  945. +   { { "68020", 5},                \
  946. +     { "c68020", 5},                \
  947. +     { "68881", 2},                \
  948. +     { "bitfield", 4},                \
  949. +     { "68000", -5},                \
  950. +     { "c68000", -5},                \
  951. +     { "soft-float", -0102},            \
  952. +     { "nobitfield", -4},            \
  953. +     { "rtd", 8},                \
  954. +     { "nortd", -8},                \
  955. +     { "short", 040},                \
  956. +     { "noshort", -040},                \
  957. +     { "fpa", 0100},                \
  958. +     { "nofpa", -0100},                \
  959. +     { "sky", 0200},                \
  960. +     { "nosky", -0200},                \
  961. +     { "68040", 0407},                \
  962. +     { "68030", -01400},                \
  963. +     { "68030", 7},                \
  964. +     { "68040-only", 01000},            \
  965. +     { "small-code", 0 },            \
  966. +     { "", TARGET_DEFAULT}}
  967. + /* Every structure or union's size must be a multiple of 2 bytes.  */
  968. + #define STRUCTURE_SIZE_BOUNDARY 16
  969. + /* This is (almost;-)) BSD, so it wants DBX format.  */
  970. + #define DBX_DEBUGGING_INFO
  971. + /* Allow folding division by zero.  */
  972. + #define REAL_INFINITY
  973. + /* The following was hacked into final.c, to allow some notice of
  974. +  * source line and filename to be injected into the assembly code,
  975. +  * even if not using one of the "approved" debuggers (albaugh@agames.com).
  976. +  */
  977. + #if 0
  978. + #define ASM_NOTE_SOURCE_LINE(FILE, LINE, FILENAME)\
  979. +   fprintf(file,"*#line %d \"%s\"\n",(LINE),(FILENAME))
  980. + #endif
  981. + #if 0    /* This apparently is no longer necessary? */
  982. + /* This is how to output an assembler line defining a `double' constant.  */
  983. + #undef ASM_OUTPUT_DOUBLE
  984. + #define ASM_OUTPUT_DOUBLE(FILE,VALUE)                    \
  985. +   {                                    \
  986. +     if (REAL_VALUE_ISINF (VALUE))                    \
  987. +       fprintf (FILE, "\t.double 0r%s99e999\n", (VALUE) > 0 ? "" : "-");    \
  988. +     else if (isnan (VALUE))                        \
  989. +       {                                    \
  990. +     union { double d; long l[2];} t;                \
  991. +     t.d = (VALUE);                            \
  992. +     fprintf (FILE, "\t.long 0x%lx\n\t.long 0x%lx\n", t.l[0], t.l[1]); \
  993. +       }                                    \
  994. +     else                                \
  995. +       fprintf (FILE, "\t.double 0r%.17g\n", VALUE);            \
  996. +   }
  997. + /* This is how to output an assembler line defining a `float' constant.  */
  998. + #undef ASM_OUTPUT_FLOAT
  999. + #define ASM_OUTPUT_FLOAT(FILE,VALUE)                    \
  1000. +   {                                    \
  1001. +     if (REAL_VALUE_ISINF (VALUE))                    \
  1002. +       fprintf (FILE, "\t.single 0r%s99e999\n", (VALUE) > 0 ? "" : "-");    \
  1003. +     else if (isnan (VALUE))                        \
  1004. +       {                                    \
  1005. +     union { float f; long l;} t;                    \
  1006. +     t.f = (VALUE);                            \
  1007. +     fprintf (FILE, "\t.long 0x%lx\n", t.l);                \
  1008. +       }                                    \
  1009. +     else                                \
  1010. +       fprintf (FILE, "\t.single 0r%.9g\n", VALUE);            \
  1011. +   }
  1012. + /* This is how to output an assembler lines defining floating operands.
  1013. +    There's no way to output a NaN's fraction, so we lose it.  */
  1014. +   
  1015. + #undef ASM_OUTPUT_FLOAT_OPERAND
  1016. + #define ASM_OUTPUT_FLOAT_OPERAND(CODE,FILE,VALUE)                \
  1017. +  do {                                \
  1018. +       if (CODE == 'f')                        \
  1019. +         {                            \
  1020. +           (REAL_VALUE_ISINF ((VALUE))                        \
  1021. +            ? asm_fprintf (FILE, "%I0r%s99e999", ((VALUE) > 0 ? "" : "-")) \
  1022. +            : (VALUE) == -0.0                            \
  1023. +            ? asm_fprintf (FILE, "%I0r-0.0")                    \
  1024. +            : asm_fprintf (FILE, "%I0r%.9g", (VALUE))) \
  1025. +         } else {                                        \
  1026. +           long l;                        \
  1027. +           REAL_VALUE_TO_TARGET_SINGLE (VALUE, l);        \
  1028. +           if (sizeof (int) == sizeof (long))            \
  1029. +             asm_fprintf ((FILE), "%I0x%x", l);            \
  1030. +           else                            \
  1031. +             asm_fprintf ((FILE), "%I0x%lx", l);            \
  1032. +         }                            \
  1033. +      } while (0)
  1034. + #undef ASM_OUTPUT_DOUBLE_OPERAND
  1035. + #define ASM_OUTPUT_DOUBLE_OPERAND(FILE,VALUE)                \
  1036. +   (REAL_VALUE_ISINF ((VALUE))                        \
  1037. +    ? asm_fprintf (FILE, "%I0r%s99e999", ((VALUE) > 0 ? "" : "-")) \
  1038. +    : (VALUE) == -0.0                            \
  1039. +    ? asm_fprintf (FILE, "%I0r-0.0")                    \
  1040. +    : asm_fprintf (FILE, "%I0r%.17g", (VALUE)))
  1041. + #endif    /* 0 */
  1042. + /* use A5 as framepointer instead of A6, this makes A6 available as a
  1043. +    general purpose register, and can thus be used without problems in
  1044. +    direct library calls. */
  1045. + #undef FRAME_POINTER_REGNUM
  1046. + #define FRAME_POINTER_REGNUM 13
  1047. + #undef ARG_POINTER_REGNUM
  1048. + #define ARG_POINTER_REGNUM 13
  1049. + /* we use A4 for this, not A5, which is the framepointer */
  1050. + #undef PIC_OFFSET_TABLE_REGNUM
  1051. + #define PIC_OFFSET_TABLE_REGNUM 12
  1052. + /* setup a default shell return value for those (gazillion..) programs that
  1053. +    (inspite of ANSI-C) declare main() to be void (or even VOID...) and thus
  1054. +    cause the shell to randomly caugh upon executing such programs (contrary
  1055. +    to Unix, AmigaDOS scripts are terminated with an error if a program returns
  1056. +    with an error code above the `error' or even `failure' level
  1057. +    (which is configurable with the FAILAT command) */
  1058. + #define DEFAULT_MAIN_RETURN c_expand_return (integer_zero_node)
  1059. + /* we do have an ansi-compliant c-library ;-) */
  1060. + #define HAVE_VPRINTF
  1061. + #define HAVE_VFPRINTF
  1062. + #define HAVE_PUTENV
  1063. + #define HAVE_STRERROR
  1064. + #define HAVE_ATEXIT
  1065. + /* given that symbolic_operand(X), return TRUE if no special
  1066. +    base relative relocation is necessary */
  1067. + #define LEGITIMATE_BASEREL_OPERAND_P(X) \
  1068. +   (flag_pic >= 3 && read_only_operand (X))
  1069. + #undef LEGITIMATE_PIC_OPERAND_P
  1070. + #define LEGITIMATE_PIC_OPERAND_P(X) \
  1071. +   (! symbolic_operand (X, VOIDmode) || LEGITIMATE_BASEREL_OPERAND_P (X))
  1072. + /* Define this macro if references to a symbol must be treated
  1073. +    differently depending on something about the variable or
  1074. +    function named by the symbol (such as what section it is in).
  1075. +    The macro definition, if any, is executed immediately after the
  1076. +    rtl for DECL or other node is created.
  1077. +    The value of the rtl will be a `mem' whose address is a
  1078. +    `symbol_ref'.
  1079. +    The usual thing for this macro to do is to a flag in the
  1080. +    `symbol_ref' (such as `SYMBOL_REF_FLAG') or to store a modified
  1081. +    name string in the `symbol_ref' (if one bit is not enough
  1082. +    information).
  1083. +    On the Amiga we use this to indicate if a symbol is in text or
  1084. +    data space.  */
  1085. + #define ENCODE_SECTION_INFO(DECL)\
  1086. + do                                    \
  1087. +   {                                    \
  1088. +     if (TREE_CODE (DECL) == FUNCTION_DECL)                \
  1089. +       SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1;            \
  1090. +     else                                \
  1091. +       {                                    \
  1092. +     rtx rtl = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd'        \
  1093. +            ? TREE_CST_RTL (DECL) : DECL_RTL (DECL));        \
  1094. +     if (RTX_UNCHANGING_P (rtl) && !MEM_VOLATILE_P (rtl))        \
  1095. +       SYMBOL_REF_FLAG (XEXP (rtl, 0)) = 1;                \
  1096. +       }                                    \
  1097. +   }                                    \
  1098. + while (0)
  1099. + #undef SELECT_RTX_SECTION
  1100. + #define SELECT_RTX_SECTION(MODE, X) readonly_data_section ();
  1101. + /* according to varasm.c, RELOC referrs *only* to whether constants (!)
  1102. +    are addressed by address. This doesn't matter in baserelative code,
  1103. +    so we allow (inspite of flag_pic) readonly_data_section() in that
  1104. +    case */
  1105. + #undef SELECT_SECTION
  1106. + #define SELECT_SECTION(DECL, RELOC)                    \
  1107. + {                                    \
  1108. +   if (TREE_CODE (DECL) == STRING_CST)                    \
  1109. +     {                                    \
  1110. +       if (! flag_writable_strings)                    \
  1111. +     readonly_data_section ();                    \
  1112. +       else                                \
  1113. +     data_section ();                        \
  1114. +     }                                    \
  1115. +   else if (TREE_CODE (DECL) == VAR_DECL)                \
  1116. +     {                                    \
  1117. +       if ((flag_pic && flag_pic < 3 && RELOC)                \
  1118. +       || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL))        \
  1119. +     data_section ();                        \
  1120. +       else                                \
  1121. +     readonly_data_section ();                    \
  1122. +     }                                    \
  1123. +   else                                    \
  1124. +     readonly_data_section ();                        \
  1125. + }
  1126. + #if not_yet_working
  1127. + /* starting support for amiga specific keywords
  1128. +  * --------------------------------------------
  1129. +  */
  1130. + /* validate attributes that don't take a parameter. Currently we support
  1131. +  * __attribute__ (saveds) and __attribute__ (interrupt)
  1132. +  */
  1133. + #define HANDLE_ATTRIBUTE0(attr) \
  1134. +   (strcmp(attr, "saveds") != 0 && strcmp(attr, "interrupt") != 0)
  1135. + /* (c-common.c)
  1136. +  * install additional attributes
  1137. +  */
  1138. + #define HANDLE_EXTRA_ATTRIBUTES(a)                         \
  1139. +   if (TREE_VALUE (a) != 0                            \
  1140. +       && TREE_CODE (TREE_VALUE (a)) == IDENTIFIER_NODE                \
  1141. +       && TREE_VALUE (a) == get_identifier ("saveds"))                \
  1142. +     {                                        \
  1143. +       if (TREE_CODE (decl) != FUNCTION_DECL)                    \
  1144. +         {                                    \
  1145. +           warning_with_decl (decl,                        \
  1146. +               "saveds attribute specified for non-function `%s'");        \
  1147. +       return;                                \
  1148. +         }                                    \
  1149. +                                               \
  1150. +       attr_do_saveds (DECL_NAME (decl));                    \
  1151. +     }                                        \
  1152. +   else if (TREE_VALUE (a) != 0                            \
  1153. +       && TREE_CODE (TREE_VALUE (a)) == IDENTIFIER_NODE                \
  1154. +       && TREE_VALUE (a) == get_identifier ("interrupt"))            \
  1155. +     {                                        \
  1156. +       if (TREE_CODE (decl) != FUNCTION_DECL)                    \
  1157. +         {                                    \
  1158. +           warning_with_decl (decl,                        \
  1159. +               "saveds attribute specified for non-function `%s'");        \
  1160. +       return;                                \
  1161. +         }                                    \
  1162. +                                               \
  1163. +       attr_do_interrupt (DECL_NAME (decl));                    \
  1164. +     }                                        \
  1165. + #define PROLOGUE_EXTRA_SAVE(mask)                        \
  1166. +   { extern char *current_function_name;                        \
  1167. +     /* saveds makes the function preserve d1/a0/a1 as well */            \
  1168. +     if (attr_does_saveds (current_function_name))                \
  1169. +       mask |= 0x40c0; }                                \
  1170. + #define EPILOGUE_EXTRA_RESTORE(mask, nregs)                    \
  1171. +   { extern char *current_function_name;                        \
  1172. +     /* restore those extra registers */                        \
  1173. +     if (attr_does_saveds (current_function_name))                \
  1174. +       {                                        \
  1175. +     mask |= 0x0302;                                \
  1176. +     nregs += 3;                                \
  1177. +       } }                                    \
  1178. + #define EPILOGUE_EXTRA_BARRIER_KLUDGE(stream)                    \
  1179. +   { extern char *current_function_name;                        \
  1180. +     /* PLEASE Help! how is this done cleaner?? */                \
  1181. +     if (attr_does_saveds (current_function_name))                \
  1182. +       {                                        \
  1183. +     fprintf (stderr,                             \
  1184. +          "warning: couldn't cleanup `saveds'-stack in `%s'.\n");    \
  1185. +     fprintf (stderr,                            \
  1186. +          "         this is only ok, if the function never returns!\n");    \
  1187. +       }    }                                    \
  1188. +         
  1189. + #define EPILOGUE_EXTRA_TEST(stream)                        \
  1190. +   { extern char *current_function_name;                        \
  1191. +     /* with the interrupt-attribute, we have to set the cc before rts */    \
  1192. +     if (attr_does_interrupt (current_function_name))                \
  1193. +       asm_fprintf (stream, "\ttstl %s\n", reg_names[0]); }            \
  1194. + #endif
  1195. diff -2rcN gcc-2.6.3/config/m68k/m68k.c gcc-2.6.3-amiga/config/m68k/m68k.c
  1196. *** gcc-2.6.3/config/m68k/m68k.c    Fri Nov 11 00:10:17 1994
  1197. --- gcc-2.6.3-amiga/config/m68k/m68k.c    Tue Dec  6 14:21:03 1994
  1198. ***************
  1199. *** 62,66 ****
  1200.   finalize_pic ()
  1201.   {
  1202. !   if (flag_pic && current_function_uses_pic_offset_table)
  1203.       emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
  1204.   }
  1205. --- 62,66 ----
  1206.   finalize_pic ()
  1207.   {
  1208. !   if (flag_pic && (flag_pic < 3) && current_function_uses_pic_offset_table)
  1209.       emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
  1210.   }
  1211. ***************
  1212. *** 142,146 ****
  1213.       {
  1214.         /* Adding negative number is faster on the 68040.  */
  1215. !       if (fsize + 4 < 0x8000)
  1216.       {
  1217.       /* asm_fprintf() cannot handle %. */
  1218. --- 142,147 ----
  1219.       {
  1220.         /* Adding negative number is faster on the 68040.  */
  1221. !         if (fsize + 4 < 0x8000)
  1222.       {
  1223.       /* asm_fprintf() cannot handle %. */
  1224. ***************
  1225. *** 197,200 ****
  1226. --- 198,204 ----
  1227.         num_saved_regs--;
  1228.       }
  1229. + #ifdef PROLOGUE_EXTRA_SAVE
  1230. +   PROLOGUE_EXTRA_SAVE (mask);
  1231. + #endif
  1232.   
  1233.   #if NEED_PROBE
  1234. ***************
  1235. *** 230,234 ****
  1236.   #endif
  1237.       }
  1238. !   if (flag_pic && current_function_uses_pic_offset_table)
  1239.       {
  1240.   #ifdef MOTOROLA
  1241. --- 234,238 ----
  1242.   #endif
  1243.       }
  1244. !   if (flag_pic && (flag_pic < 3) && current_function_uses_pic_offset_table)
  1245.       {
  1246.   #ifdef MOTOROLA
  1247. ***************
  1248. *** 295,298 ****
  1249. --- 299,305 ----
  1250.        about which function the pc is in at this address.  */
  1251.         asm_fprintf (stream, "\tnop\n");
  1252. + #ifdef EPILOGUE_EXTRA_BARRIER_KLUDGE
  1253. +       EPILOGUE_EXTRA_BARRIER_KLUDGE(stream);
  1254. + #endif
  1255.         return;
  1256.       }
  1257. ***************
  1258. *** 325,328 ****
  1259. --- 332,338 ----
  1260.       mask |= 1 << regno;
  1261.         }
  1262. + #ifdef EPILOGUE_EXTRA_RESTORE
  1263. +   EPILOGUE_EXTRA_RESTORE(mask, nregs);
  1264. + #endif
  1265.     offset = foffset + nregs * 4;
  1266.     if (offset + fsize >= 0x8000
  1267. ***************
  1268. *** 529,532 ****
  1269. --- 539,545 ----
  1270.       }
  1271.       }
  1272. + #ifdef EPILOGUE_EXTRA_TEST
  1273. +   EPILOGUE_EXTRA_TEST(stream);
  1274. + #endif
  1275.     if (current_function_pops_args)
  1276.       asm_fprintf (stream, "\trtd %0I%d\n", current_function_pops_args);
  1277. ***************
  1278. *** 819,831 ****
  1279.     if (GET_CODE (orig) == SYMBOL_REF || GET_CODE (orig) == LABEL_REF)
  1280.       {
  1281.         if (reg == 0)
  1282.       abort ();
  1283.   
  1284. !       pic_ref = gen_rtx (MEM, Pmode,
  1285. !              gen_rtx (PLUS, Pmode,
  1286. !                   pic_offset_table_rtx, orig));
  1287.         current_function_uses_pic_offset_table = 1;
  1288.         RTX_UNCHANGING_P (pic_ref) = 1;
  1289.         emit_move_insn (reg, pic_ref);
  1290.         return reg;
  1291.       }
  1292. --- 832,853 ----
  1293.     if (GET_CODE (orig) == SYMBOL_REF || GET_CODE (orig) == LABEL_REF)
  1294.       {
  1295. + #ifdef LEGITIMATE_BASEREL_OPERAND_P
  1296. +   if (LEGITIMATE_BASEREL_OPERAND_P (orig))
  1297. +     return orig;
  1298. + #endif
  1299.         if (reg == 0)
  1300.       abort ();
  1301.   
  1302. !       if (flag_pic >= 3)
  1303. !     pic_ref = gen_rtx (PLUS, Pmode, pic_offset_table_rtx, orig);
  1304. !       else
  1305. !         pic_ref = gen_rtx (MEM, Pmode,
  1306. !                gen_rtx (PLUS, Pmode,
  1307. !                     pic_offset_table_rtx, orig));
  1308.         current_function_uses_pic_offset_table = 1;
  1309.         RTX_UNCHANGING_P (pic_ref) = 1;
  1310.         emit_move_insn (reg, pic_ref);
  1311.         return reg;
  1312.       }
  1313. ***************
  1314. *** 856,859 ****
  1315. --- 878,882 ----
  1316.         /* Likewise, should we set special REG_NOTEs here?  */
  1317.       }
  1318.     return pic_ref;
  1319.   }
  1320. ***************
  1321. *** 2168,2171 ****
  1322. --- 2191,2198 ----
  1323.               if ((flag_pic == 2) && (breg == pic_offset_table_rtx))
  1324.                 fprintf (file, ":l");
  1325. +             if ((flag_pic == 3) && (breg == pic_offset_table_rtx))
  1326. +               fprintf (file, ":W");
  1327. +             if ((flag_pic == 4) && (breg == pic_offset_table_rtx))
  1328. +               fprintf (file, ":L");
  1329.             }
  1330.           if (addr != 0 && ireg != 0)
  1331. diff -2rcN gcc-2.6.3/config/m68k/m68k.h gcc-2.6.3-amiga/config/m68k/m68k.h
  1332. *** gcc-2.6.3/config/m68k/m68k.h    Sat Nov  5 19:25:00 1994
  1333. --- gcc-2.6.3-amiga/config/m68k/m68k.h    Tue Dec  6 14:21:04 1994
  1334. ***************
  1335. *** 354,360 ****
  1336.   
  1337.   #define CONDITIONAL_REGISTER_USAGE \
  1338. ! {                                               \
  1339. !   if (flag_pic)                                 \
  1340. !     fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;    \
  1341.   }
  1342.   
  1343. --- 354,363 ----
  1344.   
  1345.   #define CONDITIONAL_REGISTER_USAGE \
  1346. ! {                                                \
  1347. !   if (flag_pic)                                  \
  1348. !     fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;     \
  1349. !   /* prevent saving/restoring of the base reg */ \
  1350. !   if (flag_pic == 3)                 \
  1351. !     call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
  1352.   }
  1353.   
  1354. diff -2rcN gcc-2.6.3/config/m68k/m68k.md gcc-2.6.3-amiga/config/m68k/m68k.md
  1355. *** gcc-2.6.3/config/m68k/m68k.md    Mon Nov 21 23:42:46 1994
  1356. --- gcc-2.6.3-amiga/config/m68k/m68k.md    Tue Dec  6 14:21:04 1994
  1357. ***************
  1358. *** 378,383 ****
  1359.   ;; compare instructions.
  1360.   
  1361.   ;; A composite of the cmp, cmpa, & cmpi m68000 op codes.
  1362. ! (define_insn "cmpsi"
  1363.     [(set (cc0)
  1364.       (compare (match_operand:SI 0 "nonimmediate_operand" "rKs,mr,>")
  1365. --- 378,409 ----
  1366.   ;; compare instructions.
  1367.   
  1368. + ;; This is the second "hook" for PIC code (in addition to movsi). See
  1369. + ;; comment of movsi for a description of PIC handling.
  1370. + (define_expand "cmpsi"
  1371. +   [(set (cc0)
  1372. +     (compare (match_operand:SI 0 "nonimmediate_operand" "")
  1373. +          (match_operand:SI 1 "general_operand" "")))]
  1374. +   ""
  1375. +   "
  1376. + {
  1377. +   if (flag_pic && symbolic_operand (operands[1], SImode)) 
  1378. +     {
  1379. + #ifdef LEGITIMATE_BASEREL_OPERAND_P
  1380. +       if (flag_pic < 3 || !LEGITIMATE_BASEREL_OPERAND_P (operands[1]))
  1381. + #endif
  1382. +       {
  1383. +         /* The source is an address which requires PIC relocation.  
  1384. +            Call legitimize_pic_address with the source, mode, and a relocation
  1385. +            register (a new pseudo, or the final destination if reload_in_progress
  1386. +            is set).   Then fall through normally */
  1387. +         extern rtx legitimize_pic_address();
  1388. +         rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
  1389. +         operands[1] = legitimize_pic_address (operands[1], SImode, temp);
  1390. +       }
  1391. +     }
  1392. + }")
  1393.   ;; A composite of the cmp, cmpa, & cmpi m68000 op codes.
  1394. ! (define_insn ""
  1395.     [(set (cc0)
  1396.       (compare (match_operand:SI 0 "nonimmediate_operand" "rKs,mr,>")
  1397. ***************
  1398. *** 713,723 ****
  1399.     if (flag_pic && symbolic_operand (operands[1], SImode)) 
  1400.       {
  1401. !       /* The source is an address which requires PIC relocation.  
  1402. !          Call legitimize_pic_address with the source, mode, and a relocation
  1403. !          register (a new pseudo, or the final destination if reload_in_progress
  1404. !          is set).   Then fall through normally */
  1405. !       extern rtx legitimize_pic_address();
  1406. !       rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
  1407. !       operands[1] = legitimize_pic_address (operands[1], SImode, temp);
  1408.       }
  1409.   }")
  1410. --- 739,754 ----
  1411.     if (flag_pic && symbolic_operand (operands[1], SImode)) 
  1412.       {
  1413. ! #ifdef LEGITIMATE_BASEREL_OPERAND_P
  1414. !       if (flag_pic < 3 || !LEGITIMATE_BASEREL_OPERAND_P (operands[1]))
  1415. ! #endif
  1416. !       {
  1417. !         /* The source is an address which requires PIC relocation.  
  1418. !            Call legitimize_pic_address with the source, mode, and a relocation
  1419. !            register (a new pseudo, or the final destination if reload_in_progress
  1420. !            is set).   Then fall through normally */
  1421. !         extern rtx legitimize_pic_address();
  1422. !         rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
  1423. !         operands[1] = legitimize_pic_address (operands[1], SImode, temp);
  1424. !       }
  1425.       }
  1426.   }")
  1427. ***************
  1428. *** 1857,1862 ****
  1429.         /* These insns can result from reloads to access
  1430.        stack slots over 64k from the frame pointer.  */
  1431. !       if (GET_CODE (operands[2]) == CONST_INT
  1432. !       && INTVAL (operands[2]) + 0x8000 >= (unsigned) 0x10000)
  1433.           return \"move%.l %2,%0\;add%.l %1,%0\";
  1434.   #ifdef SGS
  1435. --- 1888,1894 ----
  1436.         /* These insns can result from reloads to access
  1437.        stack slots over 64k from the frame pointer.  */
  1438. !       if (((GET_CODE (operands[2]) == CONST_INT
  1439. !        && INTVAL (operands[2]) + 0x8000 >= (unsigned) 0x10000))
  1440. !       || (flag_pic == 4 && operands[1] == pic_offset_table_rtx))
  1441.           return \"move%.l %2,%0\;add%.l %1,%0\";
  1442.   #ifdef SGS
  1443. ***************
  1444. *** 4770,4774 ****
  1445.     "
  1446.   {
  1447. !   if (flag_pic && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
  1448.   #ifdef MOTOROLA
  1449.       SYMBOL_REF_FLAG (XEXP (operands[0], 0)) = 1;
  1450. --- 4802,4806 ----
  1451.     "
  1452.   {
  1453. !   if (flag_pic && flag_pic < 3 && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
  1454.   #ifdef MOTOROLA
  1455.       SYMBOL_REF_FLAG (XEXP (operands[0], 0)) = 1;
  1456. ***************
  1457. *** 4785,4789 ****
  1458.     ;; Operand 1 not really used on the m68000.
  1459.   
  1460. !   "! flag_pic"
  1461.     "*
  1462.   #ifdef MOTOROLA
  1463. --- 4817,4821 ----
  1464.     ;; Operand 1 not really used on the m68000.
  1465.   
  1466. !   "(! flag_pic || flag_pic >= 3)"
  1467.     "*
  1468.   #ifdef MOTOROLA
  1469. ***************
  1470. *** 4805,4809 ****
  1471.     ;; Operand 1 not really used on the m68000.
  1472.   
  1473. !   "flag_pic"
  1474.     "*
  1475.   #ifdef MOTOROLA
  1476. --- 4837,4841 ----
  1477.     ;; Operand 1 not really used on the m68000.
  1478.   
  1479. !   "(flag_pic && flag_pic < 3)"
  1480.     "*
  1481.   #ifdef MOTOROLA
  1482. ***************
  1483. *** 4830,4834 ****
  1484.     "
  1485.   {
  1486. !   if (flag_pic && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
  1487.   #ifdef MOTOROLA
  1488.       SYMBOL_REF_FLAG (XEXP (operands[1], 0)) = 1;
  1489. --- 4862,4866 ----
  1490.     "
  1491.   {
  1492. !   if (flag_pic && flag_pic < 3 && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
  1493.   #ifdef MOTOROLA
  1494.       SYMBOL_REF_FLAG (XEXP (operands[1], 0)) = 1;
  1495. ***************
  1496. *** 4845,4849 ****
  1497.             (match_operand:SI 2 "general_operand" "g")))]
  1498.     ;; Operand 2 not really used on the m68000.
  1499. !   "! flag_pic"
  1500.     "*
  1501.   #ifdef MOTOROLA
  1502. --- 4877,4881 ----
  1503.             (match_operand:SI 2 "general_operand" "g")))]
  1504.     ;; Operand 2 not really used on the m68000.
  1505. !   "(! flag_pic || flag_pic >= 3)"
  1506.     "*
  1507.   #ifdef MOTOROLA
  1508. ***************
  1509. *** 4865,4869 ****
  1510.             (match_operand:SI 2 "general_operand" "g")))]
  1511.     ;; Operand 2 not really used on the m68000.
  1512. !   "flag_pic"
  1513.     "*
  1514.   #ifdef MOTOROLA
  1515. --- 4897,4901 ----
  1516.             (match_operand:SI 2 "general_operand" "g")))]
  1517.     ;; Operand 2 not really used on the m68000.
  1518. !   "(flag_pic && flag_pic < 3)"
  1519.     "*
  1520.   #ifdef MOTOROLA
  1521. diff -2rcN gcc-2.6.3/config/m68k/t-amigados gcc-2.6.3-amiga/config/m68k/t-amigados
  1522. *** gcc-2.6.3/config/m68k/t-amigados
  1523. --- gcc-2.6.3-amiga/config/m68k/t-amigados    Tue Dec  6 20:33:31 1994
  1524. ***************
  1525. *** 0 ****
  1526. --- 1,352 ----
  1527. + # Makefile fragment for amigados target.
  1528. + # We generate two additional things:
  1529. + #
  1530. + # libb/libgcc.a
  1531. + #    A base relative version of libgcc.a which is used when compiling and
  1532. + #    linking with the '-resident' option.
  1533. + #
  1534. + # libb/libm020/libgcc.a
  1535. + #    An accelerated base relative version of libgcc.a which is used when
  1536. + #    compiling and linking with the '-mc68020' & '-resident' options.
  1537. + #
  1538. + # libm020/libgcc.a
  1539. + #    An accelerated version of libgcc.a which is used when compiling and
  1540. + #    linking with the '-mc68020' option.
  1541. + #
  1542. + # xgccv
  1543. + #    A forking gcc instead of one calling ssytem(). This makes it less
  1544. + #    system conformant (can't ^C it when started from make), while providing
  1545. + #    increased functionality (-pipe option).
  1546. + # Use the vfork'ing version of gcc by default, so that the -pipe option can
  1547. + # get tested.  To use the regular version just do "make XGCC=gcc".  Note that
  1548. + # PIPE is defined in x-amigados, so if we are doing a native build, it will
  1549. + # be defined.  It can be overridden with "make PIPE=".
  1550. + XGCC = xgccv $(PIPE)
  1551. + GCC_FOR_TARGET = ./$(XGCC) -B./
  1552. + # Build residentable versions of the gcc executables by default.  Use
  1553. + # "make RESIDENT=" to build non-residentable versions.
  1554. + # Note:  This failed during bootstrapping of 2.5.5.
  1555. + #RESIDENT = -resident
  1556. + # The standard additional target flags for the compiler.
  1557. + T_CFLAGS = $(RESIDENT)
  1558. + # Allow the user to override the default target optimizations with gcc, or if
  1559. + # the target compiler is not gcc and doesn't understand -O<N>.
  1560. + T_OPTIMISE = -O2
  1561. + # Each compilation environment (Manx, Dice, GCC, SAS/C, etc) provides its
  1562. + # own equivalent of the UNIX /usr/include tree.  For gcc, the standard headers
  1563. + # are in /gnu/include and system specific headers are in /gnu/os-include.
  1564. + # Use these paths for fixincludes.
  1565. + SYSTEM_HEADER_DIR = /gnu/include
  1566. + OTHER_FIXINCLUDES_DIRS = /gnu/os-include
  1567. + # We don't need a libgcc1, it's all in ixemul.library
  1568. + LIBGCC1 = libgcc1.null
  1569. + # Flags to use when compiling the normal version of libgcc.a.
  1570. + # Don't compile with debugging, as long as there is no debugger.
  1571. + # Explicitly leave out the -resident compilation flag and don't use T_CFLAGS.
  1572. + LIBGCC2_CFLAGS = $(T_OPTIMIZE) $(INTERNAL_CFLAGS) $(X_CFLAGS) $(CFLAGS) \
  1573. +           $(CROSS_GCC_CFLAGS)
  1574. + # Flags to use when compiling the base relative version of libgcc.a.
  1575. + # Don't compile with debugging, as long as there is no debugger.
  1576. + # Explicitly force -resident in the compilation flags and don't use T_CFLAGS.
  1577. + LIBBGCC2_CFLAGS = $(T_OPTIMIZE) $(INTERNAL_CFLAGS) $(X_CFLAGS) $(CFLAGS) \
  1578. +           $(CROSS_GCC_CFLAGS) -resident
  1579. + # Flags to use when compiling the 68020 versions of libgcc.a.
  1580. + # Don't compile with debugging, as long as there is no debugger.
  1581. + # Explicitly force -mc68020 in the compilation flags and don't use T_CFLAGS.
  1582. + LIBM020GCC2_CFLAGS = $(T_OPTIMIZE) $(INTERNAL_CFLAGS) $(X_CFLAGS) $(CFLAGS) \
  1583. +           $(CROSS_GCC_CFLAGS) -mc68020
  1584. + # Flags to use when compiling the base relative 68020 versions of libgcc.a.
  1585. + # Don't compile with debugging, as long as there is no debugger.
  1586. + # Explicitly force -mc68020 & -resident in the compilation flags and don't use
  1587. + # T_CFLAGS.
  1588. + LIBBM020GCC2_CFLAGS = $(LIBBGCC2_CFLAGS) -mc68020
  1589. + # Build the base relative library and accelerated libraries.
  1590. + # It is later copied into /gnu/lib/gcc-lib/amigados/<version>/libb/libgcc.a, whereas
  1591. + # libgcc.a is copied into /gnu/lib/gcc-lib/amigados/<version>/libgcc.a.
  1592. + # Accelerated libraries are copied into same directories, with an extra dir level
  1593. + # libm020, thus libb/libm020. It doesn't work very well to define one of the
  1594. + # EXTRA_* macros to contain libb/libgcc.a, particularly for doing "make stageN"
  1595. + # or "make install".
  1596. + GCC_PARTS=$(GCC_PASSES) libgcc.a libb/libgcc.a libm020/libgcc.a \
  1597. +         libb/libm020/libgcc.a $(EXTRA_PROGRAMS) $(USE_COLLECT2) $(EXTRA_PARTS)
  1598. + # Add install_libbgcc to normal define of INSTALL_LIBGCC.  Let install-gccv
  1599. + # hitch a ride on here as well.
  1600. + INSTALL_LIBGCC = install-libgcc install-libbgcc install-libm020gcc install-libbm020gcc install-gccv
  1601. + # This includes the knowledge that target amigados doesn't need libgcc1.a
  1602. + libb/libgcc.a: libgcc1.null libgcc2.c libgcc2.ready $(CONFIG_H) \
  1603. +    $(LIB2FUNCS_EXTRA) machmode.h longlong.h gbl-ctors.h config.status
  1604. + # Actually build it in tmplibbgcc.a, then rename at end,
  1605. + # so that libb/libgcc.a itself remains nonexistent if compilation is aborted.
  1606. +     -rm -f tmplibbgcc.a
  1607. + # -e causes any failing command to make this rule fail.
  1608. + # -e doesn't work in certain shells, so we test $$? as well.
  1609. +     set -e; \
  1610. +     for name in $(LIB2FUNCS); \
  1611. +     do \
  1612. +       echo $${name}; \
  1613. +       $(GCC_FOR_TARGET) $(LIBBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \
  1614. +           $(srcdir)/libgcc2.c -o $${name}.o; \
  1615. +       if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
  1616. +       $(AR) $(AR_FLAGS) tmplibbgcc.a $${name}.o; \
  1617. +       rm -f $${name}.o; \
  1618. +     done
  1619. + # Some shells crash when a loop has no items.
  1620. + # So make sure there is always at least one--`..'.
  1621. + # Then ignore it.
  1622. + # We don't use -e here because there are if statements
  1623. + # that should not make the command give up when the if condition is false.
  1624. + # Instead, we test for failure after each command where it matters.
  1625. +     -for file in .. $(LIB2FUNCS_EXTRA); \
  1626. +     do \
  1627. +       if [ x$${file} != x.. ]; then \
  1628. +         name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \
  1629. +         echo $${name}; \
  1630. +         if [ $${name}.asm = $${file} ]; then \
  1631. +           cp $${file} $${name}.s || exit 1; file=$${name}.s; \
  1632. +         else true; fi; \
  1633. +         $(GCC_FOR_TARGET) $(LIBBGCC2_CFLAGS) $(INCLUDES) -c $${file}; \
  1634. +         if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
  1635. +         $(AR) $(AR_FLAGS) tmplibbgcc.a $${name}.o; \
  1636. +         rm -f $${name}.[so]; \
  1637. +       else true; \
  1638. +       fi; \
  1639. +     done
  1640. +     -if $(RANLIB_TEST) ; then $(RANLIB) tmplibbgcc.a; else true; fi
  1641. +     -if [ -d libb ] ; then true ; else mkdir libb ; fi
  1642. +     mv tmplibbgcc.a libb/libgcc.a
  1643. + install-libbgcc: libb/libgcc.a install-dir
  1644. +     -if [ -d $(libsubdir)/libb ] ; then true ; else mkdir $(libsubdir)/libb ; fi
  1645. +     -if [ -f libb/libgcc.a ] ; then \
  1646. +       rm -f $(libsubdir)/libb/libgcc.a; \
  1647. +       $(INSTALL_DATA) libb/libgcc.a $(libsubdir)/libb/libgcc.a; \
  1648. +       if $(RANLIB_TEST) ; then \
  1649. +         (cd $(libsubdir)/libb; $(RANLIB) libgcc.a); else true; fi; \
  1650. +       chmod a-x $(libsubdir)/libb/libgcc.a; \
  1651. +     else true; fi
  1652. + libm020/libgcc.a: libgcc1.null libgcc2.c libgcc2.ready $(CONFIG_H) \
  1653. +    $(LIB2FUNCS_EXTRA) machmode.h longlong.h gbl-ctors.h config.status
  1654. + # Actually build it in tmplibm020gcc.a, then rename at end,
  1655. + # so that libm020/libgcc.a itself remains nonexistent if compilation is aborted.
  1656. +     -rm -f tmplibm020gcc.a
  1657. + # -e causes any failing command to make this rule fail.
  1658. + # -e doesn't work in certain shells, so we test $$? as well.
  1659. +     set -e; \
  1660. +     for name in $(LIB2FUNCS); \
  1661. +     do \
  1662. +       echo $${name}; \
  1663. +       $(GCC_FOR_TARGET) $(LIBM020GCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \
  1664. +           $(srcdir)/libgcc2.c -o $${name}.o; \
  1665. +       if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
  1666. +       $(AR) $(AR_FLAGS) tmplibm020gcc.a $${name}.o; \
  1667. +       rm -f $${name}.o; \
  1668. +     done
  1669. + # Some shells crash when a loop has no items.
  1670. + # So make sure there is always at least one--`..'.
  1671. + # Then ignore it.
  1672. + # We don't use -e here because there are if statements
  1673. + # that should not make the command give up when the if condition is false.
  1674. + # Instead, we test for failure after each command where it matters.
  1675. +     -for file in .. $(LIB2FUNCS_EXTRA); \
  1676. +     do \
  1677. +       if [ x$${file} != x.. ]; then \
  1678. +         name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \
  1679. +         echo $${name}; \
  1680. +         if [ $${name}.asm = $${file} ]; then \
  1681. +           cp $${file} $${name}.s || exit 1; file=$${name}.s; \
  1682. +         else true; fi; \
  1683. +         $(GCC_FOR_TARGET) $(LIBBGCC2_CFLAGS) $(INCLUDES) -c $${file}; \
  1684. +         if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
  1685. +         $(AR) $(AR_FLAGS) tmplibm020gcc.a $${name}.o; \
  1686. +         rm -f $${name}.[so]; \
  1687. +       else true; \
  1688. +       fi; \
  1689. +     done
  1690. +     -if $(RANLIB_TEST) ; then $(RANLIB) tmplibm020gcc.a; else true; fi
  1691. +     -if [ -d libm020 ] ; then true ; else mkdir libm020 ; fi
  1692. +     mv tmplibm020gcc.a libm020/libgcc.a
  1693. + install-libm020gcc: libm020/libgcc.a install-dir
  1694. +     -if [ -d $(libsubdir)/libm020 ] ; then true ; else mkdir $(libsubdir)/libm020 ; fi
  1695. +     -if [ -f libm020/libgcc.a ] ; then \
  1696. +       rm -f $(libsubdir)/libm020/libgcc.a; \
  1697. +       $(INSTALL_DATA) libm020/libgcc.a $(libsubdir)/libm020/libgcc.a; \
  1698. +       if $(RANLIB_TEST) ; then \
  1699. +         (cd $(libsubdir)/libm020; $(RANLIB) libgcc.a); else true; fi; \
  1700. +       chmod a-x $(libsubdir)/libm020/libgcc.a; \
  1701. +     else true; fi
  1702. + libb/libm020/libgcc.a: libgcc1.null libgcc2.c libgcc2.ready $(CONFIG_H) \
  1703. +    $(LIB2FUNCS_EXTRA) machmode.h longlong.h gbl-ctors.h config.status
  1704. + # Actually build it in tmplibbm020gcc.a, then rename at end,
  1705. + # so that libb/libm020/libgcc.a itself remains nonexistent if compilation is aborted.
  1706. +     -rm -f tmplibbm020gcc.a
  1707. + # -e causes any failing command to make this rule fail.
  1708. + # -e doesn't work in certain shells, so we test $$? as well.
  1709. +     set -e; \
  1710. +     for name in $(LIB2FUNCS); \
  1711. +     do \
  1712. +       echo $${name}; \
  1713. +       $(GCC_FOR_TARGET) $(LIBBM020GCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \
  1714. +           $(srcdir)/libgcc2.c -o $${name}.o; \
  1715. +       if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
  1716. +       $(AR) $(AR_FLAGS) tmplibbm020gcc.a $${name}.o; \
  1717. +       rm -f $${name}.o; \
  1718. +     done
  1719. + # Some shells crash when a loop has no items.
  1720. + # So make sure there is always at least one--`..'.
  1721. + # Then ignore it.
  1722. + # We don't use -e here because there are if statements
  1723. + # that should not make the command give up when the if condition is false.
  1724. + # Instead, we test for failure after each command where it matters.
  1725. +     -for file in .. $(LIB2FUNCS_EXTRA); \
  1726. +     do \
  1727. +       if [ x$${file} != x.. ]; then \
  1728. +         name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \
  1729. +         echo $${name}; \
  1730. +         if [ $${name}.asm = $${file} ]; then \
  1731. +           cp $${file} $${name}.s || exit 1; file=$${name}.s; \
  1732. +         else true; fi; \
  1733. +         $(GCC_FOR_TARGET) $(LIBBGCC2CFLAGS) $(INCLUDES) -c $${file}; \
  1734. +         if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
  1735. +         $(AR) $(AR_FLAGS) tmplibbm020gcc.a $${name}.o; \
  1736. +         rm -f $${name}.[so]; \
  1737. +       else true; \
  1738. +       fi; \
  1739. +     done
  1740. +     -if $(RANLIB_TEST) ; then $(RANLIB) tmplibbm020gcc.a; else true; fi
  1741. +     -if [ -d libb ] ; then true ; else mkdir libb ; fi
  1742. +     -if [ -d libb/libm020 ] ; then true ; else mkdir libb/libm020 ; fi
  1743. +     mv tmplibbm020gcc.a libb/libm020/libgcc.a
  1744. + install-libbm020gcc: libb/libm020/libgcc.a install-dir
  1745. +     -if [ -d $(libsubdir)/libb/libm020 ] ; then true ; else mkdir $(libsubdir)/libb/libm020 ; fi
  1746. +     -if [ -f libb/libm020/libgcc.a ] ; then \
  1747. +       rm -f $(libsubdir)/libb/libm020/libgcc.a; \
  1748. +       $(INSTALL_DATA) libb/libm020/libgcc.a $(libsubdir)/libb/libm020/libgcc.a; \
  1749. +       if $(RANLIB_TEST) ; then \
  1750. +         (cd $(libsubdir)/libb/libm020; $(RANLIB) libgcc.a); else true; fi; \
  1751. +       chmod a-x $(libsubdir)/libb/libm020/libgcc.a; \
  1752. +     else true; fi
  1753. + # PhB:
  1754. + # toplev.o target need to define additional flags to handle stack
  1755. + # allocation in real main. As for now we hack building of toplev.o
  1756. + # defining MAYBE_USE_COLLECT2 flag, which is only used for toplev.o.
  1757. + # Then we define EXTRA_OBJS to amigasup.o.
  1758. + MAYBE_USE_COLLECT2= -Dmain=stkmain -Dexit=stkexit
  1759. + EXTRA_OBJS = amigasup.o
  1760. + # The default gcc (xgcc) is built without -DAMIGADOS_FORK_GCC. This gcc (xgccv)
  1761. + # is built with AMIGADOS_FORK_GCC defined, so that it can use '-pipe'.  We
  1762. + # don't want to define EXTRA_PASSES to xgccv because that will cause xgccv
  1763. + # to be installed in $(libsubdir), so instead we use the default GCC_PASSES
  1764. + # and add xgccv to it.
  1765. + GCC_PASSES = xgcc xgccv cc1 cpp $(EXTRA_PASSES)
  1766. + xgccv: xgccv.o version.o $(LIBDEPS)
  1767. +     $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o xgccv xgccv.o version.o $(LIBS)
  1768. + xgccv.o: gcc.c $(CONFIG_H) config.status
  1769. +     $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
  1770. +   -DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \
  1771. +   -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \
  1772. +   -DDEFAULT_TARGET_VERSION=\"$(version)\" \
  1773. +   -DDEFAULT_TARGET_MACHINE=\"$(target)\" \
  1774. +   -DTOOLDIR_BASE_PREFIX=\"$(exec_prefix)/\" \
  1775. +   -DAMIGADOS_FORK_GCC \
  1776. +   -c `echo $(srcdir)/gcc.c | sed 's,^\./,,'` -o xgccv.o
  1777. + install-gccv: xgccv
  1778. +     rm -f $(bindir)/gccv
  1779. +     $(INSTALL_PROGRAM) xgccv $(bindir)/gccv
  1780. + # When making one of the stage<N> dirs, we need to make subdirs for
  1781. + # additional libraries, and copy them there. base-relative libraries
  1782. + # and accelerated libraries are preserved through stages.
  1783. + EXTRA_STAGE1_TARGETS = stage1-libamiga
  1784. + EXTRA_STAGE2_TARGETS = stage2-libamiga
  1785. + EXTRA_STAGE3_TARGETS = stage3-libamiga
  1786. + EXTRA_STAGE4_TARGETW = stage4-libamiga
  1787. + stage1-libamiga:
  1788. +     -if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi
  1789. +     -if [ -d stage1/libb ] ; then true ; else mkdir stage1/libb ; fi
  1790. +     -if [ -d stage1/libb/libm020 ] ; then true ; else mkdir stage1/libb/libm020 ; fi
  1791. +     -if [ -d stage1/libm020 ] ; then true ; else mkdir stage1/libm020 ; fi
  1792. +     -cp libb/libgcc.a stage1/libb/libgcc.a
  1793. +     -cp libb/libm020/libgcc.a stage1/libb/libm020/libgcc.a
  1794. +     -cp libm020/libgcc.a stage1/libm020/libgcc.a
  1795. +     -if $(RANLIB_TEST) ; then $(RANLIB) stage1/libb/libgcc.i; else true; fi
  1796. +     -if $(RANLIB_TEST) ; then $(RANLIB) stage1/libb/libm020/libgcc.a; else true; fi
  1797. +     -if $(RANLIB_TEST) ; then $(RANLIB) stage1/libm020/libgcc.a; else true; fi
  1798. + stage2-libamiga:
  1799. +     -if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi
  1800. +     -if [ -d stage2/libb ] ; then true ; else mkdir stage2/libb ; fi
  1801. +     -if [ -d stage2/libb/libm020 ] ; then true ; else mkdir stage2/libb/libm020 ; fi
  1802. +     -if [ -d stage2/libm020 ] ; then true ; else mkdir stage2/libm020 ; fi
  1803. +     -cp libb/libgcc.a stage2/libb/libgcc.a
  1804. +     -cp libb/libm020/libgcc.a stage2/libb/libm020/libgcc.a
  1805. +     -cp libm020/libgcc.a stage2/libm020/libgcc.a
  1806. +     -if $(RANLIB_TEST) ; then $(RANLIB) stage2/libb/libgcc.a; else true; fi
  1807. +     -if $(RANLIB_TEST) ; then $(RANLIB) stage2/libb/libm020/libgcc.a; else true; fi
  1808. +     -if $(RANLIB_TEST) ; then $(RANLIB) stage2/libm020/libgcc.a; else true; fi
  1809. + stage3-libamiga:
  1810. +     -if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi
  1811. +     -if [ -d stage3/libb ] ; then true ; else mkdir stage3/libb ; fi
  1812. +     -if [ -d stage3/libb/libm020 ] ; then true ; else mkdir stage3/libb/libm020 ; fi
  1813. +     -if [ -d stage3/libm020 ] ; then true ; else mkdir stage3/libm020 ; fi
  1814. +     -cp libb/libgcc.a stage3/libb/libgcc.a
  1815. +     -cp libb/libm020/libgcc.a stage3/libb/libm020/libgcc.a
  1816. +     -cp libm020/libgcc.a stage3/libm020/libgcc.a
  1817. +     -if $(RANLIB_TEST) ; then $(RANLIB) stage3/libb/libgcc.a; else true; fi
  1818. +     -if $(RANLIB_TEST) ; then $(RANLIB) stage3/libb/libm020/libgcc.a; else true; fi
  1819. +     -if $(RANLIB_TEST) ; then $(RANLIB) stage3/libm020/libgcc.a; else true; fi
  1820. + stage4-libamiga:
  1821. +     -if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi
  1822. +     -if [ -d stage4/libb ] ; then true ; else mkdir stage4/libb ; fi
  1823. +     -if [ -d stage4/libb/libm020 ] ; then true ; else mkdir stage4/libb/libm020 ; fi
  1824. +     -if [ -d stage4/libm020 ] ; then true ; else mkdir stage4/libm020 ; fi
  1825. +     -cp libb/libgcc.a stage4/libb/libgcc.a
  1826. +     -cp libb/libm020/libgcc.a stage4/libb/libm020/libgcc.a
  1827. +     -cp libm020/libgcc.a stage4/libm020/libgcc.a
  1828. +     -if $(RANLIB_TEST) ; then $(RANLIB) stage4/libb/libgcc.a; else true; fi
  1829. +     -if $(RANLIB_TEST) ; then $(RANLIB) stage4/libb/libm020/libgcc.a; else true; fi
  1830. +     -if $(RANLIB_TEST) ; then $(RANLIB) stage4/libm020/libgcc.a; else true; fi
  1831. diff -2rcN gcc-2.6.3/config/m68k/x-amigados gcc-2.6.3-amiga/config/m68k/x-amigados
  1832. *** gcc-2.6.3/config/m68k/x-amigados
  1833. --- gcc-2.6.3-amiga/config/m68k/x-amigados    Tue Dec  6 14:21:05 1994
  1834. ***************
  1835. *** 0 ****
  1836. --- 1,44 ----
  1837. + # Note: It doesn't do any good to try to define prefix or local_prefix
  1838. + # in the host overrides because configure will just change them back.
  1839. + # You either have to give an appropriate option to configure or live with
  1840. + # an Amiga specific patch to configure.  See the note in configure.  -fnf
  1841. + # Building under amigados almost certainly requires an already working gcc.
  1842. + # Use gccv, which is a gcc compiled with AMIGADOS_FORK_GCC so "-pipe" will
  1843. + # work and get exercised.  To bootstrap with the regular gcc just do
  1844. + # "make CC=gcc".  To bootstrap without "-pipe" do "make PIPE=".
  1845. + CC = gccv $(PIPE)
  1846. + # Disable -pipe for now since I had problems bootstrapping gcc 2.5.5 with
  1847. + # it. (fnf)
  1848. + #PIPE = -pipe
  1849. + # Allow the user to override the default host optimization with gcc, or if the
  1850. + # host compiler is not gcc and doesn't understand -O<N>.
  1851. + X_OPTIMIZE = -O2
  1852. + # The standard additional host flags for the compiler.
  1853. + X_CFLAGS = $(X_OPTIMIZE)
  1854. + # Man pages get a wierd suffix...
  1855. + manext = .0
  1856. + # We really shouldn't specify CFLAGS from here, but there's no other way
  1857. + # to get rid of the `-g' indoctrinated by Makefile.in.  Note this becomes
  1858. + # part of both the host compilation CFLAGS and the target compilation
  1859. + # CFLAGS.
  1860. + CFLAGS =
  1861. + # Ranlib does exist, but may not be in a path where the default RANLIB_TEST
  1862. + # expects it, so just force it to true.
  1863. + RANLIB_TEST = true
  1864. + # My current version of ln doesn't work, so use cp instead.  -fnf
  1865. + HARDLINK = cp
  1866. diff -2rcN gcc-2.6.3/config/m68k/xm-amigados.h gcc-2.6.3-amiga/config/m68k/xm-amigados.h
  1867. *** gcc-2.6.3/config/m68k/xm-amigados.h
  1868. --- gcc-2.6.3-amiga/config/m68k/xm-amigados.h    Tue Dec  6 14:21:05 1994
  1869. ***************
  1870. *** 0 ****
  1871. --- 1,218 ----
  1872. + /* Configuration for GNU C-compiler for Commodore Amiga, running AmigaDOS.
  1873. +    Copyright (C) 1992 Free Software Foundation, Inc.
  1874. +    Contributed by Markus M. Wild (wild@amiga.physik.unizh.ch).
  1875. + This file is part of GNU CC.
  1876. + GNU CC is free software; you can redistribute it and/or modify
  1877. + it under the terms of the GNU General Public License as published by
  1878. + the Free Software Foundation; either version 2, or (at your option)
  1879. + any later version.
  1880. + GNU CC is distributed in the hope that it will be useful,
  1881. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  1882. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1883. + GNU General Public License for more details.
  1884. + You should have received a copy of the GNU General Public License
  1885. + along with GNU CC; see the file COPYING.  If not, write to
  1886. + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  1887. + /* first include the generic header, then modify some parts.. */
  1888. + #include "m68k/xm-m68k.h"
  1889. + /* Amiga specific headers, such as from the Native Developer Update kits,
  1890. +    go in SYSTEM_INCLUDE_DIR.  STANDARD_INCLUDE_DIR is the equivalent of
  1891. +    Unix "/usr/include".  All other include paths are set in Makefile. */
  1892. + #define SYSTEM_INCLUDE_DIR    "/gnu/os-include"
  1893. + #define STANDARD_INCLUDE_DIR    "/gnu/include"
  1894. + /* Fork one piped subcommand.  SEARCH_FLAG is the system call to use
  1895. +    (either execv or execvp).  ARGV is the arg vector to use.
  1896. +    NOT_LAST is nonzero if this is not the last subcommand
  1897. +    (i.e. its output should be piped to the next one.)  */
  1898. + #ifndef AMIGADOS_FORK_GCC
  1899. + /* This version uses a more or less amigados-conformant way of running a
  1900. +    program (in the context of the parent). If you want to use -pipe however,
  1901. +    you'll have to use the vfork() version afterwards.
  1902. +    Phil.B: 29-May-94 quick hack (number 20 added to length) because xgcc
  1903. +    doesn't work.
  1904. +  */
  1905. + #define PEXECUTE(SEARCH_FLAG,PROGRAM,ARGV,NOT_LAST) \
  1906. + ({char *_argline;                        \
  1907. +   int _arglinelength, _i;                    \
  1908. +                                 \
  1909. +   for (_i = 1, _arglinelength=0; ARGV[_i]; ++_i)        \
  1910. +     _arglinelength += strlen(ARGV[_i]) + 1;            \
  1911. +                                 \
  1912. +   _arglinelength += strlen(PROGRAM) + 20 + 1;            \
  1913. +                                 \
  1914. +   if (!(_argline = (char *)alloca(_arglinelength)))         \
  1915. +     pfatal_with_name ("alloca");                \
  1916. +                                 \
  1917. +   strcpy(_argline, PROGRAM);                    \
  1918. +   for (_i = 1; ARGV[_i]; ++_i)                     \
  1919. +     {                                \
  1920. +       strcat(_argline, " ");                    \
  1921. +       strcat(_argline, ARGV[_i]);                \
  1922. +     }                                \
  1923. +                                 \
  1924. +   ssystem(_argline); })                        \
  1925. + #define PEXECUTE_RESULT(STATUS, COMMAND) \
  1926. +   ({ STATUS = COMMAND.pid; })
  1927. + #else
  1928. + /* the vfork() version. This one has the drawback, that gcc is not 
  1929. +    interruptible when started from make, since ixemul.library doesn't yet
  1930. +    propagate ^C to subprocesses. */
  1931. + #define PEXECUTE(SEARCH_FLAG,PROGRAM,ARGV,NOT_LAST) \
  1932. + ({int (*_func)() = (SEARCH_FLAG ? execv : execvp);            \
  1933. +   int _pid;                                \
  1934. +   int _pdes[2];                                \
  1935. +   int _input_desc = last_pipe_input;                    \
  1936. +   int _output_desc = STDOUT_FILE_NO;                    \
  1937. +   int _retries, _sleep_interval, _result;                \
  1938. +                                     \
  1939. +   /* If this isn't the last process, make a pipe for its output,    \
  1940. +      and record it as waiting to be the input to the next process.  */    \
  1941. +                                     \
  1942. +   if (NOT_LAST)                                \
  1943. +     {                                    \
  1944. +       if (pipe (_pdes) < 0)                        \
  1945. +     pfatal_with_name ("pipe");                    \
  1946. +       _output_desc = _pdes[WRITE_PORT];                    \
  1947. +       last_pipe_input = _pdes[READ_PORT];                \
  1948. +     }                                    \
  1949. +   else                                    \
  1950. +     last_pipe_input = STDIN_FILE_NO;                    \
  1951. +                                     \
  1952. +   /* Fork a subprocess; wait and retry if it fails.  */            \
  1953. +   _sleep_interval = 1;                            \
  1954. +   for (_retries = 0; _retries < 4; _retries++)                \
  1955. +     {                                    \
  1956. +       _pid = vfork ();                            \
  1957. +       if (_pid >= 0)                            \
  1958. +     break;                                \
  1959. +       sleep (_sleep_interval);                        \
  1960. +       _sleep_interval *= 2;                        \
  1961. +     }                                    \
  1962. +                                     \
  1963. +   switch (_pid)                                \
  1964. +     {                                    \
  1965. +     case -1:                                \
  1966. +       pfatal_with_name ("vfork");                    \
  1967. +       /* NOTREACHED */                            \
  1968. +       _result = 0;                            \
  1969. +       break;                                \
  1970. +                                     \
  1971. +     case 0: /* child */                            \
  1972. +       /* Move the input and output pipes into place, if nec.  */    \
  1973. +       if (_input_desc != STDIN_FILE_NO)                    \
  1974. +     {                                \
  1975. +       close (STDIN_FILE_NO);                    \
  1976. +       dup (_input_desc);                        \
  1977. +       close (_input_desc);                        \
  1978. +     }                                \
  1979. +       if (_output_desc != STDOUT_FILE_NO)                \
  1980. +     {                                \
  1981. +       close (STDOUT_FILE_NO);                    \
  1982. +       dup (_output_desc);                        \
  1983. +       close (_output_desc);                        \
  1984. +     }                                \
  1985. +                                     \
  1986. +       /* Close the parent's descs that aren't wanted here.  */        \
  1987. +       if (last_pipe_input != STDIN_FILE_NO)                \
  1988. +     close (last_pipe_input);                    \
  1989. +                                     \
  1990. +       /* Exec the program.  */                        \
  1991. +       (*_func) (PROGRAM, ARGV);                        \
  1992. +       perror_exec (PROGRAM);                        \
  1993. +       exit (-1);                            \
  1994. +       /* NOTREACHED */                            \
  1995. +       _result = 0;                            \
  1996. +       break;                                \
  1997. +                                     \
  1998. +     default:                                \
  1999. +       /* In the parent, after forking.                    \
  2000. +      Close the descriptors that we made for this child.  */        \
  2001. +       if (_input_desc != STDIN_FILE_NO)                    \
  2002. +     close (_input_desc);                        \
  2003. +       if (_output_desc != STDOUT_FILE_NO)                \
  2004. +     close (_output_desc);                        \
  2005. +                                     \
  2006. +       /* Return child's process number.  */                \
  2007. +       _result = _pid;                            \
  2008. +       break;                                \
  2009. +     }                                     \
  2010. + _result; })                                \
  2011. + #define PEXECUTE_RESULT(STATUS, COMMAND) \
  2012. +   ({ wait (& STATUS); })
  2013. + #endif /* AMIGADOS_FORK_GCC */
  2014. + /* the following macros are stolen more or less from xm-vms.h ... */
  2015. + /* This macro is used to help compare filenames in cp-lex.c.
  2016. +    We also need to make sure that the names are all lower case, because
  2017. +    we must be able to compare filenames to determine if a file implements
  2018. +    a class.  */
  2019. + #define FILE_NAME_NONDIRECTORY(C)                \
  2020. + ({                                \
  2021. +    extern char *rindex();                    \
  2022. +    char * pnt_ = (C), * pnt1_;                    \
  2023. +    pnt1_ = pnt_ - 1;                        \
  2024. +    while (*++pnt1_)                        \
  2025. +      if ((*pnt1_ >= 'A' && *pnt1_ <= 'Z')) *pnt1_ |= 0x20;    \
  2026. +    pnt1_ = rindex (pnt_, '/');                     \
  2027. +    pnt1_ = (pnt1_ == 0 ? rindex (pnt_, ':') : pnt1_);        \
  2028. +    (pnt1_ == 0 ? pnt_ : pnt1_ + 1);                \
  2029. +  })
  2030. + /* Macro to generate the name of the cross reference file.  The standard
  2031. +    one does not work, since it was written assuming that the conventions
  2032. +    of a unix style filesystem will work on the host system.
  2033. +  
  2034. +    Contrary to VMS, I'm using the original unix filename, there's no reason
  2035. +    not to use this under AmigaDOS. */
  2036. + #define XREF_FILE_NAME(BUFF, NAME)    \
  2037. +   s = FILE_NAME_NONDIRECTORY (NAME);            \
  2038. +   if (s == NAME) sprintf(BUFF, ".%s.gxref", NAME);    \
  2039. +   else {                        \
  2040. +     unsigned char ch = *s; /* could be Latin1 char.. */    \
  2041. +     /* temporary: cut the filename from the directory */\
  2042. +     *s = 0;                        \
  2043. +     sprintf (BUFF, "%s.%c%s.gxref", NAME, ch, s+1);    \
  2044. +     /* and restore the filename */            \
  2045. +     *s = ch;                        \
  2046. +   }                            \
  2047. + /* Macro that is used in cp-xref.c to determine whether a file name is
  2048. +    absolute or not.
  2049. +    This checks for both, '/' as first character, since we're running under
  2050. +    ixemul.library which provides for this unix'ism, and for the usual 
  2051. +    logical-terminator, ':', somewhere in the filename. */
  2052. + #define FILE_NAME_ABSOLUTE_P(NAME) (NAME[0] == '/' || index(NAME, ':'))
  2053. + /* the colon conflicts with the name space of logicals */
  2054. + #define PATH_SEPARATOR ','
  2055. + /* AmigaDOS handles rename(2) *much* better than any link(2)/unlink(2)
  2056. +    hacks. It's actually the inverse case as on Unix. rename(2) was always
  2057. +    there, link(2) is new with OS 2.0 */
  2058. + #define HAVE_rename 1
  2059. diff -2rcN gcc-2.6.3/configure gcc-2.6.3-amiga/configure
  2060. *** gcc-2.6.3/configure    Wed Nov 23 22:26:27 1994
  2061. --- gcc-2.6.3-amiga/configure    Tue Dec 27 10:35:51 1994
  2062. ***************
  2063. *** 5,8 ****
  2064. --- 5,12 ----
  2065.   #This file is part of GNU CC.
  2066.   
  2067. + # AmigaDOS Notes:  Where "echo" can be invoked with a first arg that
  2068. + # starts with '-', run the external echo instead, since the pdksh builtin
  2069. + # version botches this case.
  2070.   #GNU CC is free software; you can redistribute it and/or modify
  2071.   #it under the terms of the GNU General Public License as published by
  2072. ***************
  2073. *** 47,52 ****
  2074.   # Default --srcdir to the directory where the script is found, 
  2075.   # if a directory was specified.
  2076. ! # The second sed call is to convert `.//configure' to `./configure'.
  2077. ! srcdir=`echo $0 | sed 's|//|/|' | sed 's|/[^/]*$||'`
  2078.   if [ x$srcdir = x$0 ]
  2079.   then
  2080. --- 51,58 ----
  2081.   # Default --srcdir to the directory where the script is found, 
  2082.   # if a directory was specified.
  2083. ! # The first sed call works around a bug in the AmigaDOS port of sksh, where
  2084. ! # $0 has a trailing slash appended to it.  It is a NOP for other systems.
  2085. ! # The third sed call is to convert `.//configure' to `./configure'.
  2086. ! srcdir=`echo $0 | sed 's|/$||' | sed 's|//|/|' | sed 's|/[^/]*$||'`
  2087.   if [ x$srcdir = x$0 ]
  2088.   then
  2089. ***************
  2090. *** 56,69 ****
  2091.   host=
  2092.   
  2093. ! # Default prefix to /usr/local.
  2094. ! prefix=/usr/local
  2095.   
  2096. ! # local_prefix specifies where to find the directory /usr/local/include
  2097.   # We don't use $(prefix) for this
  2098. ! # because we always want GCC to search /usr/local/include
  2099. ! # even if GCC is installed somewhere other than /usr/local.
  2100.   # Think THREE TIMES before specifying any other value for this!
  2101.   # DO NOT make this use $prefix!
  2102. ! local_prefix=/usr/local
  2103.   # Default is to let the Makefile set exec_prefix from $(prefix)
  2104.   exec_prefix='$(prefix)'
  2105. --- 62,85 ----
  2106.   host=
  2107.   
  2108. ! # Note:  For AmigaDOS we want this to default to /gnu unless we specify
  2109. ! # otherwise to configure.  We also don't want to have to remember to always
  2110. ! # configure with "--prefix=/gnu".  Changing it in Makefile.in or in
  2111. ! # config/m68k/x-amigados is ineffective since configure will always change
  2112. ! # it back in the final generated Makefile, so we have to go to the root of
  2113. ! # the problem, which is here.  There should be a way to do this in the
  2114. ! # individual machine configuration files!  -fnf
  2115. ! # here.  -fnf
  2116. ! # Default prefix to "/gnu".
  2117. ! prefix=/gnu
  2118.   
  2119. ! # local_prefix specifies where to find the directory /gnu/local/include
  2120.   # We don't use $(prefix) for this
  2121. ! # because we always want GCC to search /gnu/local/include
  2122. ! # even if GCC is installed somewhere other than /gnu/local.
  2123.   # Think THREE TIMES before specifying any other value for this!
  2124.   # DO NOT make this use $prefix!
  2125. ! # Note:  See AmigaDOS note above for this AmigaDOS specific change.  -fnf
  2126. ! # NoteII:We don't want to have yet-another-assign so we use /gnu/local
  2127. ! local_prefix=/gnu/local
  2128.   # Default is to let the Makefile set exec_prefix from $(prefix)
  2129.   exec_prefix='$(prefix)'
  2130. ***************
  2131. *** 73,78 ****
  2132.   
  2133.   remove=rm
  2134. ! hard_link=ln
  2135. ! symbolic_link='ln -s'
  2136.   copy=cp
  2137.   
  2138. --- 89,99 ----
  2139.   
  2140.   remove=rm
  2141. ! # AmigaDOS specific change.  Although we support symbolic links using
  2142. ! # the GNU tools, they need to be made using the syntax "somewhere:foo/bar"
  2143. ! # and not "/somewhere/foo/bar", since they must be in standard AmigaDOS
  2144. ! # format.  This should probably be done by having GNU ln translate paths
  2145. ! # that start with '/' to canonical AmigaDOS device:name form.
  2146. ! hard_link=cp
  2147. ! symbolic_link=cp
  2148.   copy=cp
  2149.   
  2150. ***************
  2151. *** 142,146 ****
  2152.       ;;
  2153.        -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
  2154. !     srcdir=`echo $arg | sed 's/-*s[a-z]*=//'`
  2155.       ;;
  2156.        -host | --host | --hos | --ho)
  2157. --- 163,167 ----
  2158.       ;;
  2159.        -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
  2160. !     srcdir=`/bin/echo $arg | sed 's/-*s[a-z]*=//'`
  2161.       ;;
  2162.        -host | --host | --hos | --ho)
  2163. ***************
  2164. *** 148,152 ****
  2165.       ;;
  2166.        -host=* | --host=* | --hos=* | --ho=*)
  2167. !     host=`echo $arg | sed 's/-*h[a-z]*=//'`
  2168.       ;; 
  2169.        -target | --target | --targe | --targ | --tar | --ta | --t)
  2170. --- 169,173 ----
  2171.       ;;
  2172.        -host=* | --host=* | --hos=* | --ho=*)
  2173. !     host=`/bin/echo $arg | sed 's/-*h[a-z]*=//'`
  2174.       ;; 
  2175.        -target | --target | --targe | --targ | --tar | --ta | --t)
  2176. ***************
  2177. *** 154,158 ****
  2178.       ;;
  2179.        -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
  2180. !     target=`echo $arg | sed 's/-*t[a-z]*=//'`
  2181.       ;; 
  2182.        -build | --build | --buil | --bui | --bu | --b)
  2183. --- 175,179 ----
  2184.       ;;
  2185.        -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
  2186. !     target=`/bin/echo $arg | sed 's/-*t[a-z]*=//'`
  2187.       ;; 
  2188.        -build | --build | --buil | --bui | --bu | --b)
  2189. ***************
  2190. *** 160,164 ****
  2191.       ;;
  2192.        -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*)
  2193. !     build=`echo $arg | sed 's/-*b[a-z]*=//'`
  2194.       ;; 
  2195.        -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  2196. --- 181,185 ----
  2197.       ;;
  2198.        -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*)
  2199. !     build=`/bin/echo $arg | sed 's/-*b[a-z]*=//'`
  2200.       ;; 
  2201.        -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  2202. ***************
  2203. *** 166,170 ****
  2204.       ;;
  2205.        -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  2206. !     prefix=`echo $arg | sed 's/-*p[a-z]*=//'`
  2207.       ;;
  2208.        -local-prefix | --local-prefix | --local-prefi | --local-pref | --local-pre \
  2209. --- 187,191 ----
  2210.       ;;
  2211.        -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  2212. !     prefix=`/bin/echo $arg | sed 's/-*p[a-z]*=//'`
  2213.       ;;
  2214.        -local-prefix | --local-prefix | --local-prefi | --local-pref | --local-pre \
  2215. ***************
  2216. *** 175,179 ****
  2217.       | --local-pre=* | --local-pr=* | --local-p=* | --local-=* | --local=* \
  2218.       | --loc=* | --lo=* | --l=*)
  2219. !     local_prefix=`echo $arg | sed 's/-*l[-a-z]*=//'`
  2220.       ;;
  2221.        -gxx-include-dir | --gxx-include-dir | --gxx-include \
  2222. --- 196,200 ----
  2223.       | --local-pre=* | --local-pr=* | --local-p=* | --local-=* | --local=* \
  2224.       | --loc=* | --lo=* | --l=*)
  2225. !     local_prefix=`/bin/echo $arg | sed 's/-*l[-a-z]*=//'`
  2226.       ;;
  2227.        -gxx-include-dir | --gxx-include-dir | --gxx-include \
  2228. ***************
  2229. *** 185,189 ****
  2230.       | --gxx-incl=* | --gxx-inc=* | --gxx-in=* | --gxx-i=* \
  2231.       | --gxx-=* | --gxx=* | --gxx=* | --gxx=* | --g=*)
  2232. !     gxx_include_dir=`echo $arg | sed 's/-*g[-a-z]*=//'`
  2233.       ;;
  2234.        -exec-prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre \
  2235. --- 206,210 ----
  2236.       | --gxx-incl=* | --gxx-inc=* | --gxx-in=* | --gxx-i=* \
  2237.       | --gxx-=* | --gxx=* | --gxx=* | --gxx=* | --g=*)
  2238. !     gxx_include_dir=`/bin/echo $arg | sed 's/-*g[-a-z]*=//'`
  2239.       ;;
  2240.        -exec-prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre \
  2241. ***************
  2242. *** 194,198 ****
  2243.       | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* \
  2244.       | --exe=* | --ex=* | --e=*)
  2245. !     exec_prefix=`echo $arg | sed 's/-*e[-a-z]*=//'`
  2246.       ;;
  2247.        -with-gnu-ld | --with-gnu-ld | --with-gnu-l)
  2248. --- 215,219 ----
  2249.       | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* \
  2250.       | --exe=* | --ex=* | --e=*)
  2251. !     exec_prefix=`/bin/echo $arg | sed 's/-*e[-a-z]*=//'`
  2252.       ;;
  2253.        -with-gnu-ld | --with-gnu-ld | --with-gnu-l)
  2254. ***************
  2255. *** 390,394 ****
  2256.       # Set this to override the default target model.
  2257.       target_cpu_default=
  2258. !     # Set this to force use of install.sh.
  2259.       broken_install=
  2260.       # Set this to control which fixincludes program to use.
  2261. --- 411,416 ----
  2262.       # Set this to override the default target model.
  2263.       target_cpu_default=
  2264. !     # Set this to force use of install.sh (if set to 'yes')
  2265. !     # Set to name of installer to use a custom installer.
  2266.       broken_install=
  2267.       # Set this to control which fixincludes program to use.
  2268. ***************
  2269. *** 1098,1101 ****
  2270. --- 1120,1133 ----
  2271.           header_files=math-68881.h
  2272.           ;;
  2273. +     m68k-*-amigados)
  2274. +         xm_file=m68k/xm-amigados.h
  2275. +         out_file=m68k/amigados.c
  2276. +         tm_file=m68k/amigados.h
  2277. +         tmake_file=m68k/t-amigados
  2278. +         xmake_file=m68k/x-amigados
  2279. +         fixincludes=Makefile.in # Headers are already fixed.
  2280. +         broken_install=cp
  2281. +         install_headers_dir=install-headers-cp
  2282. +         ;;
  2283.       m68k-cbm-sysv4*)        # Commodore variant of V.4.
  2284.           tm_file=m68k/amix.h
  2285. ***************
  2286. *** 2117,2122 ****
  2287.       else
  2288.           rm -f Makefile.xx
  2289. !         abssrcdir=`cd ${srcdir}; pwd`
  2290. !         sed "s|^INSTALL = .*|INSTALL = ${abssrcdir}/install.sh -c|" Makefile.tem > Makefile.xx
  2291.           rm -f Makefile.tem
  2292.           mv Makefile.xx Makefile.tem
  2293. --- 2149,2160 ----
  2294.       else
  2295.           rm -f Makefile.xx
  2296. !          if [ x$host_broken_install = xyes ]
  2297. !          then
  2298. !              abssrcdir=`cd ${srcdir}; pwd`
  2299. !              installer=${abssrcdir}/install.sh -c
  2300. !          else
  2301. !              installer=$host_broken_install
  2302. !          fi
  2303. !          sed "s|^INSTALL = .*|INSTALL = ${installer}|" Makefile.tem > Makefile.xx
  2304.           rm -f Makefile.tem
  2305.           mv Makefile.xx Makefile.tem
  2306. ***************
  2307. *** 2337,2344 ****
  2308.           if $symbolic_link symtest1.tem symtest.tem 2>/dev/null
  2309.           then
  2310. !             sed -e 's,CC=set-by-configure,CC=$(CC),' \
  2311.                   Makefile.tem > Makefile.xx
  2312.           else
  2313. !             sed -e "s,CC=set-by-configure,CC=\`case '$(CC)' in stage*) echo '$(CC)' | sed -e 's|stage|../stage|g';; *) echo '$(CC)';; esac\`," \
  2314.                   Makefile.tem > Makefile.xx
  2315.           fi
  2316. --- 2375,2382 ----
  2317.           if $symbolic_link symtest1.tem symtest.tem 2>/dev/null
  2318.           then
  2319. !             sed -e 's,CC=set-by-configure,CC=\$(CC),' \
  2320.                   Makefile.tem > Makefile.xx
  2321.           else
  2322. !             sed -e "s,CC=set-by-configure,CC=\`case '\$(CC)' in stage*) echo '\$(CC)' | sed -e 's|stage|../stage|g';; *) echo '\$(CC)';; esac\`," \
  2323.                   Makefile.tem > Makefile.xx
  2324.           fi
  2325. diff -2rcN gcc-2.6.3/final.c gcc-2.6.3-amiga/final.c
  2326. *** gcc-2.6.3/final.c    Wed Sep 21 01:05:03 1994
  2327. --- gcc-2.6.3-amiga/final.c    Tue Dec  6 14:21:06 1994
  2328. ***************
  2329. *** 2022,2025 ****
  2330. --- 2022,2029 ----
  2331.     if (write_symbols != NO_DEBUG)
  2332.       {
  2333. + /* Phil.B: 03-Oct-94 added q_anote from albaugh@agames.com (Mike Albaugh) */
  2334. + #if defined(amigados) && defined(ASM_NOTE_SOURCE_LINE)
  2335. +   ASM_NOTE_SOURCE_LINE(file,last_linenum,filename);
  2336. + #endif
  2337.   #ifdef SDB_DEBUGGING_INFO
  2338.         if (write_symbols == SDB_DEBUG
  2339. diff -2rcN gcc-2.6.3/gcc.c gcc-2.6.3-amiga/gcc.c
  2340. *** gcc-2.6.3/gcc.c    Mon Nov  7 16:01:43 1994
  2341. --- gcc-2.6.3-amiga/gcc.c    Tue Dec  6 14:21:07 1994
  2342. ***************
  2343. *** 208,211 ****
  2344. --- 208,216 ----
  2345.   static int save_temps_flag;
  2346.   
  2347. + #ifdef amigados
  2348. + /* Phil.B: 03-Oct-94 Flag indicating process priority */
  2349. + static int amiga_priority = 0;
  2350. + #endif /* amigados */
  2351.   /* The compiler version.  */
  2352.   
  2353. ***************
  2354. *** 837,840 ****
  2355. --- 842,849 ----
  2356.      {"--pipe", "-pipe", 0},
  2357.      {"--prefix", "-B", "a"},
  2358. + /* Phil.B: 03-Oct-94, allow priority settings for all programs started by gcc */
  2359. + #ifdef amigados
  2360. +    {"--priority", "-P", "a"},
  2361. + #endif /* amigados */
  2362.      {"--preprocess", "-E", 0},
  2363.      {"--print-file-name", "-print-file-name=", "aj"},
  2364. ***************
  2365. *** 985,990 ****
  2366.           }
  2367.         i++;
  2368. -     }
  2369.   
  2370.         /* Handle old-fashioned options--just copy them through,
  2371.        with their arguments.  */
  2372. --- 994,999 ----
  2373.           }
  2374.         i++;
  2375.   
  2376. +     }
  2377.         /* Handle old-fashioned options--just copy them through,
  2378.        with their arguments.  */
  2379. ***************
  2380. *** 1340,1348 ****
  2381.   
  2382.   #ifndef STANDARD_EXEC_PREFIX
  2383. ! #define STANDARD_EXEC_PREFIX "/usr/local/lib/gcc-lib/"
  2384.   #endif /* !defined STANDARD_EXEC_PREFIX */
  2385.   
  2386.   static char *standard_exec_prefix = STANDARD_EXEC_PREFIX;
  2387. ! static char *standard_exec_prefix_1 = "/usr/lib/gcc/";
  2388.   #ifdef MD_EXEC_PREFIX
  2389.   static char *md_exec_prefix = MD_EXEC_PREFIX;
  2390. --- 1349,1357 ----
  2391.   
  2392.   #ifndef STANDARD_EXEC_PREFIX
  2393. ! #define STANDARD_EXEC_PREFIX "/gnu/lib/gcc-lib/"
  2394.   #endif /* !defined STANDARD_EXEC_PREFIX */
  2395.   
  2396.   static char *standard_exec_prefix = STANDARD_EXEC_PREFIX;
  2397. ! static char *standard_exec_prefix_1 = "/local/lib/gcc-lib/";
  2398.   #ifdef MD_EXEC_PREFIX
  2399.   static char *md_exec_prefix = MD_EXEC_PREFIX;
  2400. ***************
  2401. *** 1350,1354 ****
  2402.   
  2403.   #ifndef STANDARD_STARTFILE_PREFIX
  2404. ! #define STANDARD_STARTFILE_PREFIX "/usr/local/lib/"
  2405.   #endif /* !defined STANDARD_STARTFILE_PREFIX */
  2406.   
  2407. --- 1359,1363 ----
  2408.   
  2409.   #ifndef STANDARD_STARTFILE_PREFIX
  2410. ! #define STANDARD_STARTFILE_PREFIX "/gnu/lib/"
  2411.   #endif /* !defined STANDARD_STARTFILE_PREFIX */
  2412.   
  2413. ***************
  2414. *** 1360,1368 ****
  2415.   #endif
  2416.   static char *standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
  2417. ! static char *standard_startfile_prefix_1 = "/lib/";
  2418. ! static char *standard_startfile_prefix_2 = "/usr/lib/";
  2419.   
  2420.   #ifndef TOOLDIR_BASE_PREFIX
  2421. ! #define TOOLDIR_BASE_PREFIX "/usr/local/"
  2422.   #endif
  2423.   static char *tooldir_base_prefix = TOOLDIR_BASE_PREFIX;
  2424. --- 1369,1377 ----
  2425.   #endif
  2426.   static char *standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
  2427. ! static char *standard_startfile_prefix_1 = "/local/lib/";
  2428. ! static char *standard_startfile_prefix_2 = "/local/lib/";
  2429.   
  2430.   #ifndef TOOLDIR_BASE_PREFIX
  2431. ! #define TOOLDIR_BASE_PREFIX "/local/"
  2432.   #endif
  2433.   static char *tooldir_base_prefix = TOOLDIR_BASE_PREFIX;
  2434. ***************
  2435. *** 1565,1568 ****
  2436. --- 1574,1581 ----
  2437.   #endif
  2438.   
  2439. + #ifdef amigados
  2440. +   if (!base) /* No env var set */
  2441. +     base = "RAM:";
  2442. + #else
  2443.     base = choose_temp_base_try (concat4 (dir_separator_str, "usr", 
  2444.                                           dir_separator_str, "tmp"), 
  2445. ***************
  2446. *** 1570,1573 ****
  2447. --- 1583,1588 ----
  2448.     base = choose_temp_base_try (concat (dir_separator_str, "tmp"), base);
  2449.    
  2450. + #endif
  2451.     /* If all else fails, use the current directory! */  
  2452.     if (base == (char *)0) base = concat(".", dir_separator_str);
  2453. ***************
  2454. *** 1578,1582 ****
  2455.     strcpy (temp_filename, base);
  2456.     if (len > 0 && temp_filename[len-1] != '/'
  2457. !       && temp_filename[len-1] != DIR_SEPARATOR)
  2458.       temp_filename[len++] = DIR_SEPARATOR;
  2459.     strcpy (temp_filename + len, "ccXXXXXX");
  2460. --- 1593,1601 ----
  2461.     strcpy (temp_filename, base);
  2462.     if (len > 0 && temp_filename[len-1] != '/'
  2463. !       && temp_filename[len-1] != DIR_SEPARATOR
  2464. ! #ifdef amigados
  2465. !                         && temp_filename[len-1] != ':'
  2466. ! #endif
  2467. !     )
  2468.       temp_filename[len++] = DIR_SEPARATOR;
  2469.     strcpy (temp_filename + len, "ccXXXXXX");
  2470. ***************
  2471. *** 1723,1727 ****
  2472.     /* Determine the filename to execute (special case for absolute paths).  */
  2473.   
  2474. !   if (*name == '/' || *name == DIR_SEPARATOR)
  2475.       {
  2476.         if (access (name, mode))
  2477. --- 1742,1750 ----
  2478.     /* Determine the filename to execute (special case for absolute paths).  */
  2479.   
  2480. !   if (*name == '/' || *name == DIR_SEPARATOR
  2481. ! #ifdef amigados
  2482. !           || index (name, ':')
  2483. ! #endif
  2484. !     )
  2485.       {
  2486.         if (access (name, mode))
  2487. ***************
  2488. *** 1943,1946 ****
  2489. --- 1966,1970 ----
  2490.      (i.e. its output should be piped to the next one.)  */
  2491.   
  2492. + #ifndef PEXECUTE
  2493.   #ifdef __MSDOS__
  2494.   
  2495. ***************
  2496. *** 2144,2149 ****
  2497.     return (search_flag ? spawnv : spawnvp) (1, program, FIX_ARGV (argv));
  2498.   }
  2499. ! #endif /* OS2 or WINNT */
  2500.   
  2501.   /* Execute the command specified by the arguments on the current line of spec.
  2502. --- 2168,2173 ----
  2503.     return (search_flag ? spawnv : spawnvp) (1, program, FIX_ARGV (argv));
  2504.   }
  2505. ! #endif /* OS2 or WINNT*/
  2506. ! #endif /* !defined (PEXECUTE) */
  2507.   
  2508.   /* Execute the command specified by the arguments on the current line of spec.
  2509. ***************
  2510. *** 2240,2246 ****
  2511. --- 2264,2276 ----
  2512.         char *string = commands[i].argv[0];
  2513.   
  2514. + #ifdef PEXECUTE
  2515. +       commands[i].pid = PEXECUTE (string != commands[i].prog,
  2516. +                   string, commands[i].argv,
  2517. +                   i + 1 < n_commands);
  2518. + #else
  2519.         commands[i].pid = pexecute (string != commands[i].prog,
  2520.                     string, commands[i].argv,
  2521.                     i + 1 < n_commands);
  2522. + #endif
  2523.   
  2524.         if (string != commands[i].prog)
  2525. ***************
  2526. *** 2263,2266 ****
  2527. --- 2293,2299 ----
  2528.       char *prog = "unknown";
  2529.   
  2530. + #ifdef PEXECUTE_RESULT
  2531. +     pid = PEXECUTE_RESULT (status, commands[i]);
  2532. + #else /* PEXECUTE_RESULT */
  2533.   #ifdef __MSDOS__
  2534.           status = pid = commands[i].pid;
  2535. ***************
  2536. *** 2272,2275 ****
  2537. --- 2305,2309 ----
  2538.   #endif
  2539.   #endif
  2540. + #endif /* PEXECUTE_RESULT */
  2541.       if (pid < 0)
  2542.         abort ();
  2543. ***************
  2544. *** 2390,2393 ****
  2545. --- 2424,2428 ----
  2546.           {
  2547.             strncpy (nstore, startp, endp-startp);
  2548. + #ifndef amigados
  2549.             if (endp == startp)
  2550.           strcpy (nstore, concat (".", dir_separator_str));
  2551. ***************
  2552. *** 2399,2402 ****
  2553. --- 2434,2446 ----
  2554.             else
  2555.           nstore[endp-startp] = 0;
  2556. + #else
  2557. +           if (endp[-1] != '/' && endp[-1] != ':')
  2558. +         {
  2559. +           nstore[endp-startp] = '/';
  2560. +           nstore[endp-startp+1] = 0;
  2561. +         }
  2562. +           else
  2563. +         nstore[endp-startp] = 0;
  2564. + #endif
  2565.             add_prefix (&exec_prefixes, nstore, 0, 0, NULL_PTR);
  2566.             if (*endp == 0)
  2567. ***************
  2568. *** 2421,2424 ****
  2569. --- 2465,2469 ----
  2570.           {
  2571.             strncpy (nstore, startp, endp-startp);
  2572. + #ifndef amigados
  2573.             if (endp == startp)
  2574.           strcpy (nstore, concat (".", dir_separator_str));
  2575. ***************
  2576. *** 2430,2433 ****
  2577. --- 2475,2487 ----
  2578.             else
  2579.           nstore[endp-startp] = 0;
  2580. + #else
  2581. +           if (endp[-1] != '/' && endp[-1] != ':')
  2582. +         {
  2583. +           nstore[endp-startp] = '/';
  2584. +           nstore[endp-startp+1] = 0;
  2585. +         }
  2586. +           else
  2587. +         nstore[endp-startp] = 0;
  2588. + #endif
  2589.             add_prefix (&startfile_prefixes, nstore, 0, 0, NULL_PTR);
  2590.             if (*endp == 0)
  2591. ***************
  2592. *** 2453,2460 ****
  2593.           {
  2594.             strncpy (nstore, startp, endp-startp);
  2595.             if (endp == startp)
  2596.           strcpy (nstore, concat (".", dir_separator_str));
  2597.             else if (endp[-1] != '/' && endp[-1] != DIR_SEPARATOR)
  2598. !         {
  2599.             nstore[endp-startp] = DIR_SEPARATOR;
  2600.             nstore[endp-startp+1] = 0;
  2601. --- 2507,2515 ----
  2602.           {
  2603.             strncpy (nstore, startp, endp-startp);
  2604. + #ifndef amigados
  2605.             if (endp == startp)
  2606.           strcpy (nstore, concat (".", dir_separator_str));
  2607.             else if (endp[-1] != '/' && endp[-1] != DIR_SEPARATOR)
  2608. !           {
  2609.             nstore[endp-startp] = DIR_SEPARATOR;
  2610.             nstore[endp-startp+1] = 0;
  2611. ***************
  2612. *** 2462,2465 ****
  2613. --- 2517,2529 ----
  2614.             else
  2615.           nstore[endp-startp] = 0;
  2616. + #else
  2617. +           if (endp[-1] != '/' && endp[-1] != ':')
  2618. +         {
  2619. +           nstore[endp-startp] = '/';
  2620. +           nstore[endp-startp+1] = 0;
  2621. +         }
  2622. +           else
  2623. +         nstore[endp-startp] = 0;
  2624. + #endif
  2625.             add_prefix (&startfile_prefixes, nstore, 0, 0, NULL_PTR);
  2626.             if (*endp == 0)
  2627. ***************
  2628. *** 2481,2484 ****
  2629. --- 2545,2558 ----
  2630.     for (i = 1; i < argc; i++)
  2631.       {
  2632. + #ifdef amigados
  2633. +       /* Phil.B 03-Oct-94 added -priority keyword */
  2634. +       if (! strcmp (argv[i], "-priority"))
  2635. +         {
  2636. +       if (i + 1 == argc)
  2637. +         fatal ("argument to `-priority' is missing");
  2638. +           amiga_priority = atoi(argv[++i]);
  2639. +         }
  2640. +       else
  2641. + #endif /* amigados */
  2642.         if (! strcmp (argv[i], "-dumpspecs"))
  2643.       {
  2644. ***************
  2645. *** 2658,2661 ****
  2646. --- 2732,2746 ----
  2647.             break;
  2648.   
  2649. + #ifdef amigados
  2650. +             case 'P': /* Phil.B 03-Oct-94 added -priority keyword */
  2651. +           if (p[1] == 0 && i + 1 == argc)
  2652. +         fatal ("argument to `-P' is missing");
  2653. +           if (p[1] == 0)
  2654. +         amiga_priority = atoi(argv[++i]);
  2655. +           else
  2656. +         amiga_priority = atoi((char *)(p + 1));
  2657. +           break;
  2658. + #endif /* amigados */
  2659.           case 'v':    /* Print our subcommands and print versions.  */
  2660.             n_switches++;
  2661. ***************
  2662. *** 2746,2753 ****
  2663.     add_prefix (&exec_prefixes, 
  2664.                 concat3 (tooldir_prefix, "bin", dir_separator_str),
  2665. !           0, 0, NULL_PTR);
  2666.     add_prefix (&startfile_prefixes,
  2667.             concat3 (tooldir_prefix, "lib", dir_separator_str),
  2668. !           0, 0, NULL_PTR);
  2669.   
  2670.     /* More prefixes are enabled in main, after we read the specs file
  2671. --- 2831,2838 ----
  2672.     add_prefix (&exec_prefixes, 
  2673.                 concat3 (tooldir_prefix, "bin", dir_separator_str),
  2674. !             0, 0, NULL_PTR);
  2675.     add_prefix (&startfile_prefixes,
  2676.             concat3 (tooldir_prefix, "lib", dir_separator_str),
  2677. !             0, 0, NULL_PTR);
  2678.   
  2679.     /* More prefixes are enabled in main, after we read the specs file
  2680. ***************
  2681. *** 2830,2834 ****
  2682.         register int c = *p;
  2683.   
  2684. !       if (c == 'B' || c == 'b' || c == 'V')
  2685.           {
  2686.             /* Skip a separate arg, if any.  */
  2687. --- 2915,2924 ----
  2688.         register int c = *p;
  2689.   
  2690. !           /* Phil.B: 05-Oct-94 added support for '-P' */
  2691. !       if (c == 'B' || c == 'b' || c == 'V'
  2692. ! #ifdef amigados
  2693. !           || c == 'P'
  2694. ! #endif /* amigdos */
  2695. ! )
  2696.           {
  2697.             /* Skip a separate arg, if any.  */
  2698. ***************
  2699. *** 4398,4405 ****
  2700. --- 4488,4499 ----
  2701.         int len;
  2702.   
  2703. + #ifdef FILE_NAME_NONDIRECTORY
  2704. +       input_basename = FILE_NAME_NONDIRECTORY (input_filename);
  2705. + #else
  2706.         input_basename = input_filename;
  2707.         for (p = input_filename; *p; p++)
  2708.           if (*p == '/' || *p == DIR_SEPARATOR)
  2709.             input_basename = p + 1;
  2710. + #endif
  2711.   
  2712.         /* Find a suffix starting with the last period,
  2713. ***************
  2714. *** 4613,4628 ****
  2715.   }
  2716.   
  2717. ! /* Return a newly-allocated string whose contents concatenate those of s1, s2 */
  2718.   
  2719. ! static char *
  2720.   concat (s1, s2)
  2721.        char *s1, *s2;
  2722. ! {
  2723.     int len1 = strlen (s1);
  2724.     int len2 = strlen (s2);
  2725.     char *result = xmalloc (len1 + len2 + 1);
  2726. !   strcpy (result, s1);
  2727. !   strcpy (result + len1, s2);
  2728.     *(result + len1 + len2) = 0;
  2729.   
  2730. --- 4707,4722 ----
  2731.   }
  2732.   
  2733. ! /* Return a newly-allocated string whose contents concatenate those of s1, s2, s3.  */
  2734.   
  2735. !   static char *
  2736.   concat (s1, s2)
  2737.        char *s1, *s2;
  2738. !   {
  2739.     int len1 = strlen (s1);
  2740.     int len2 = strlen (s2);
  2741.     char *result = xmalloc (len1 + len2 + 1);
  2742. !   
  2743. !     strcpy (result, s1);
  2744. !     strcpy (result + len1, s2);
  2745.     *(result + len1 + len2) = 0;
  2746.   
  2747. diff -2rcN gcc-2.6.3/genconfig.c gcc-2.6.3-amiga/genconfig.c
  2748. *** gcc-2.6.3/genconfig.c    Wed Jun 15 08:37:01 1994
  2749. --- gcc-2.6.3-amiga/genconfig.c    Tue Dec  6 14:21:07 1994
  2750. ***************
  2751. *** 304,309 ****
  2752. --- 304,317 ----
  2753.   from the machine description file `md'.  */\n\n");
  2754.   
  2755. + #ifdef amigados
  2756. +   /* this constant probably better be 14 in general, or a cross compiling
  2757. +      host might choke on some amigados header files... */
  2758. +   /* Allow at least 14 operands for the sake of asm constructs.  */
  2759. +   max_recog_operands = 14;
  2760. + #else
  2761.     /* Allow at least 10 operands for the sake of asm constructs.  */
  2762.     max_recog_operands = 9;  /* We will add 1 later.  */
  2763. + #endif
  2764.     max_dup_operands = 1;
  2765.   
  2766. diff -2rcN gcc-2.6.3/ginclude/stdarg.h gcc-2.6.3-amiga/ginclude/stdarg.h
  2767. *** gcc-2.6.3/ginclude/stdarg.h    Sat Jul  9 03:04:27 1994
  2768. --- gcc-2.6.3-amiga/ginclude/stdarg.h    Tue Dec  6 14:21:08 1994
  2769. ***************
  2770. *** 157,159 ****
  2771. --- 157,167 ----
  2772.   
  2773.   #endif /* not _ANSI_STDARG_H_ */
  2774. + #ifdef amigados
  2775. + # ifndef _VA_LIST
  2776. + #  define _VA_LIST
  2777. +    typedef __gnuc_va_list va_list;
  2778. + # endif
  2779. + #endif /* amigados */
  2780.   #endif /* not _STDARG_H */
  2781. diff -2rcN gcc-2.6.3/ginclude/stddef.h gcc-2.6.3-amiga/ginclude/stddef.h
  2782. *** gcc-2.6.3/ginclude/stddef.h    Thu Nov 17 22:26:41 1994
  2783. --- gcc-2.6.3-amiga/ginclude/stddef.h    Tue Dec  6 14:21:08 1994
  2784. ***************
  2785. *** 4,7 ****
  2786. --- 4,47 ----
  2787.   #ifndef __STDDEF_H__
  2788.   
  2789. + #ifdef amigados
  2790. + /* GNU libc has special support in this file, 4.3bsd-net2 libc deserves that
  2791. +    just as well. The system headers are ANSI compliant, the used compiler IS
  2792. +    gcc, so it's really ok to use the system header, no reason to hassle
  2793. +    with a jungle of ifdefs. Besides, amigados is only defined if compiling
  2794. +    with host=amigados, it doesn't apply if compiling with target=amigados
  2795. +    on a different host with possibly different system headers. Same thing
  2796. +    would apply to gstdarg.h and gvarargs.h, but those headers are more
  2797. +    easily fixable than this one and I'm sick of writing the same comment
  2798. +    there as well. MW
  2799. +    Include the contents of <stddef.h> inline rather than with a #include,
  2800. +    to avoid infinite include recursion when this file is installed in
  2801. +    gcc's include directory as stddef.h.  (fnf)  */
  2802. + #define _STDDEF_H_
  2803. + #include <machine/ansi.h>
  2804. + typedef    _PTRDIFF_T_    ptrdiff_t;
  2805. + #ifdef    _SIZE_T_
  2806. + typedef    _SIZE_T_    size_t;
  2807. + #undef    _SIZE_T_
  2808. + #endif
  2809. + #ifdef    _WCHAR_T_
  2810. + typedef    _WCHAR_T_    wchar_t;
  2811. + #undef    _WCHAR_T_
  2812. + #endif
  2813. + #ifndef    NULL
  2814. + #define    NULL    0
  2815. + #endif
  2816. + #define    offsetof(type, member)    ((size_t)(&((type *)0)->member))
  2817. + #else /* not amigados */
  2818.   /* Any one of these symbols __need_* means that GNU libc
  2819.      wants us just to define one data type.  So don't define
  2820. ***************
  2821. *** 213,216 ****
  2822. --- 253,258 ----
  2823.   #define __WCHAR_TYPE__ int
  2824.   #endif
  2825. + #endif /* not  amigados */
  2826.   typedef __WCHAR_TYPE__ wchar_t;
  2827.   #endif
  2828. diff -2rcN gcc-2.6.3/ginclude/varargs.h gcc-2.6.3-amiga/ginclude/varargs.h
  2829. *** gcc-2.6.3/ginclude/varargs.h    Sat Jul  9 03:04:32 1994
  2830. --- gcc-2.6.3-amiga/ginclude/varargs.h    Tue Dec  6 14:21:08 1994
  2831. ***************
  2832. *** 174,175 ****
  2833. --- 174,182 ----
  2834.   #undef _BSD_VA_LIST
  2835.   #endif
  2836. + #ifdef amigados
  2837. + # ifndef _VA_LIST
  2838. + #  define _VA_LIST
  2839. +    typedef __gnuc_va_list va_list;
  2840. + # endif
  2841. + #endif /* amigados */
  2842. Binary files gcc-2.6.3/libb/libgcc.a and gcc-2.6.3-amiga/libb/libgcc.a differ
  2843. Binary files gcc-2.6.3/libb/libm020/libgcc.a and gcc-2.6.3-amiga/libb/libm020/libgcc.a differ
  2844. Binary files gcc-2.6.3/libm020/libgcc.a and gcc-2.6.3-amiga/libm020/libgcc.a differ
  2845. diff -2rcN gcc-2.6.3/protoize.c gcc-2.6.3-amiga/protoize.c
  2846. *** gcc-2.6.3/protoize.c    Tue Nov  8 02:27:44 1994
  2847. --- gcc-2.6.3-amiga/protoize.c    Tue Dec  6 14:21:09 1994
  2848. ***************
  2849. *** 848,853 ****
  2850. --- 848,858 ----
  2851.     struct default_include *p;
  2852.   
  2853. + #ifdef FILE_NAME_ABSOLUTE_P
  2854. +   if (! FILE_NAME_ABSOLUTE_P (path))
  2855. +     abort ();
  2856. + #else
  2857.     if (path[0] != '/')
  2858.       abort ();        /* Must be an absolutized filename.  */
  2859. + #endif
  2860.   
  2861.     for (p = include_defaults; p->fname; p++)
  2862. ***************
  2863. *** 1276,1280 ****
  2864. --- 1281,1289 ----
  2865.       const char *src_p;
  2866.   
  2867. + #ifdef FILE_NAME_ABSOLUTE_P
  2868. +     if (! FILE_NAME_ABSOLUTE_P (rel_filename))
  2869. + #else
  2870.       if (rel_filename[0] != '/')
  2871. + #endif
  2872.         {
  2873.           src_p = cwd2;
  2874. ***************
  2875. *** 1539,1542 ****
  2876. --- 1548,1570 ----
  2877.   }
  2878.   
  2879. + /* Use this macro to advance a char * over the filename part in a line
  2880. +    read from an aux-info file. */
  2881. + #ifndef amigados
  2882. + /* Version for file systems where the colon has no special meaning */
  2883. + #define ADVANCE_PAST_FILENAME(CP) \
  2884. +   while (* (CP) != ':') (CP)++
  2885. + #else
  2886. + /* Have to heuristically decide whether the colon is part of the filename
  2887. +    or whether it serves to delimit the filename from the line number. If
  2888. +    it's the latter case, then the character following the colon *must*
  2889. +    be a digit. Note that this heuristic fails if the filename starts
  2890. +    with a digit. */
  2891. + #define ADVANCE_PAST_FILENAME(CP) \
  2892. +     while ((CP)[0] != ':' || !isdigit ((CP)[1])) \
  2893. +       (CP)++;
  2894. + #endif
  2895.   /* Given a line from  an aux info file, and a time at which the aux info
  2896.      file it came from was created, check to see if the item described in
  2897. ***************
  2898. *** 1560,1565 ****
  2899.       const char *filename_start = p = l + 3;
  2900.   
  2901. !     while (*p != ':')
  2902. !       p++;
  2903.       filename = (char *) alloca ((size_t) (p - filename_start) + 1);
  2904.       strncpy (filename, filename_start, (size_t) (p - filename_start));
  2905. --- 1588,1592 ----
  2906.       const char *filename_start = p = l + 3;
  2907.   
  2908. !     ADVANCE_PAST_FILENAME (p);
  2909.       filename = (char *) alloca ((size_t) (p - filename_start) + 1);
  2910.       strncpy (filename, filename_start, (size_t) (p - filename_start));
  2911. ***************
  2912. *** 1618,1623 ****
  2913.       char *filename;
  2914.   
  2915. !     while (*p != ':')
  2916. !       p++;
  2917.       filename = (char *) alloca ((size_t) (p - filename_start) + 1);
  2918.       strncpy (filename, filename_start, (size_t) (p - filename_start));
  2919. --- 1645,1649 ----
  2920.       char *filename;
  2921.   
  2922. !     ADVANCE_PAST_FILENAME (p);
  2923.       filename = (char *) alloca ((size_t) (p - filename_start) + 1);
  2924.       strncpy (filename, filename_start, (size_t) (p - filename_start));
  2925. ***************
  2926. *** 2339,2343 ****
  2927.       char *p = aux_info_base;
  2928.   
  2929. !     while (*p != ':')
  2930.         p++;
  2931.       p++;
  2932. --- 2365,2371 ----
  2933.       char *p = aux_info_base;
  2934.   
  2935. !     /* have to make sure at least one space is following the colon to make
  2936. !        sure the colon is not part of the filename */
  2937. !     while (*p != ':' && p[1] != ' ')
  2938.         p++;
  2939.       p++;
  2940. ***************
  2941. *** 2353,2357 ****
  2942.       aux_info_second_line = p;
  2943.       aux_info_relocated_name = 0;
  2944. !     if (invocation_filename[0] != '/')
  2945.         {
  2946.       /* INVOCATION_FILENAME is relative;
  2947. --- 2381,2389 ----
  2948.       aux_info_second_line = p;
  2949.       aux_info_relocated_name = 0;
  2950. ! #ifdef FILE_NAME_ABSOLUTE_P
  2951. !     if (! FILE_NAME_ABSOLUTE_P (invocation_filename))
  2952. ! #else
  2953. !       if (invocation_filename[0] != '/')
  2954. ! #endif
  2955.         {
  2956.       /* INVOCATION_FILENAME is relative;
  2957. ***************
  2958. *** 2442,2446 ****
  2959.   
  2960.   /* Check an individual filename for a .c suffix.  If the filename has this
  2961. !    suffix, rename the file such that its suffix is changed to .C.  This
  2962.      function implements the -C option.  */
  2963.   
  2964. --- 2474,2478 ----
  2965.   
  2966.   /* Check an individual filename for a .c suffix.  If the filename has this
  2967. !    suffix, rename the file such that its suffix is changed to .cc.  This
  2968.      function implements the -C option.  */
  2969.   
  2970. ***************
  2971. *** 2451,2455 ****
  2972.     const char *filename = hp->symbol;
  2973.     int last_char_index = strlen (filename) - 1;
  2974. !   char *const new_filename = (char *) alloca (strlen (filename) + 1);
  2975.   
  2976.     /* Note that we don't care here if the given file was converted or not.  It
  2977. --- 2483,2487 ----
  2978.     const char *filename = hp->symbol;
  2979.     int last_char_index = strlen (filename) - 1;
  2980. !   char *const new_filename = (char *) alloca (strlen (filename) + 2);
  2981.   
  2982.     /* Note that we don't care here if the given file was converted or not.  It
  2983. ***************
  2984. *** 2463,2468 ****
  2985.   
  2986.     strcpy (new_filename, filename);
  2987. !   new_filename[last_char_index] = 'C';
  2988.   
  2989.     if (my_link (filename, new_filename) == -1)
  2990.       {
  2991. --- 2495,2517 ----
  2992.   
  2993.     strcpy (new_filename, filename);
  2994. !   strcat (new_filename + last_char_index, "cc");
  2995. !   
  2996. !   /* use rename(2) if available !! Update config files to include HAVE_rename
  2997. !      if the used OS provides it. Advantages are: it's atomic, it's one
  2998. !      system call compared to two. */
  2999. ! #ifdef HAVE_rename
  3000. !   /* if the mentioned systems (POSIX 1003.1-1988) have rename(2), this has
  3001. !      to be changed to `my_rename' as well. */
  3002.   
  3003. +   if (rename (filename, new_filename) == -1)
  3004. +     {
  3005. +       fprintf (stderr, "%s: warning: can't rename file `%s' to `%s': %s\n",
  3006. +            pname, shortpath (NULL, filename),
  3007. +            shortpath (NULL, new_filename), sys_errlist[errno]);
  3008. +       errors++;
  3009. +       return;
  3010. +     }
  3011. + #else
  3012.     if (my_link (filename, new_filename) == -1)
  3013.       {
  3014. ***************
  3015. *** 2481,2484 ****
  3016. --- 2530,2534 ----
  3017.         return;
  3018.       }
  3019. + #endif
  3020.   }
  3021.   
  3022. diff -2rcN gcc-2.6.3/real.c gcc-2.6.3-amiga/real.c
  3023. *** gcc-2.6.3/real.c    Sat Nov  5 18:57:08 1994
  3024. --- gcc-2.6.3-amiga/real.c    Tue Dec  6 14:21:09 1994
  3025. ***************
  3026. *** 4280,4286 ****
  3027. --- 4280,4292 ----
  3028.       {
  3029.         if (sign)
  3030. + #ifdef amigados
  3031.       sprintf (wstring, " -Infinity ");
  3032.         else
  3033.       sprintf (wstring, " Infinity ");
  3034. + #else
  3035. +     sprintf (wstring, " -NaN ");
  3036. +       else
  3037. +     sprintf (wstring, " NaN ");
  3038. + #endif
  3039.         goto bxit;
  3040.       }
  3041. diff -2rcN gcc-2.6.3/scan-types.sh gcc-2.6.3-amiga/scan-types.sh
  3042. *** gcc-2.6.3/scan-types.sh    Mon Apr 18 08:07:12 1994
  3043. --- gcc-2.6.3-amiga/scan-types.sh    Tue Dec  6 14:21:10 1994
  3044. ***************
  3045. *** 1,3 ****
  3046. ! #! /bin/sh
  3047.   # Deduce values of standard ANSI and POSIX types (e.g. size_t, pid_t).
  3048.   # Emits macros definitions for these, and some other types.
  3049. --- 1,3 ----
  3050. ! #!/bin/sh
  3051.   # Deduce values of standard ANSI and POSIX types (e.g. size_t, pid_t).
  3052.   # Emits macros definitions for these, and some other types.
  3053. diff -2rcN gcc-2.6.3/toplev.c gcc-2.6.3-amiga/toplev.c
  3054. *** gcc-2.6.3/toplev.c    Tue Oct 25 20:09:12 1994
  3055. --- gcc-2.6.3-amiga/toplev.c    Tue Dec 27 10:48:46 1994
  3056. ***************
  3057. *** 531,534 ****
  3058. --- 531,535 ----
  3059.     {"writable-strings", &flag_writable_strings, 1},
  3060.     {"peephole", &flag_no_peephole, 0},
  3061. +   {"large-baserel", &flag_pic, 4},
  3062.     {"force-mem", &flag_force_mem, 1},
  3063.     {"force-addr", &flag_force_addr, 1},
  3064. ***************
  3065. *** 549,552 ****
  3066. --- 550,554 ----
  3067.     {"pic", &flag_pic, 1},
  3068.     {"PIC", &flag_pic, 2},
  3069. +   {"baserel", &flag_pic, 3},
  3070.     {"fast-math", &flag_fast_math, 1},
  3071.     {"common", &flag_no_common, 0},
  3072. ***************
  3073. *** 1967,1970 ****
  3074. --- 1969,1975 ----
  3075.        char *input_name;
  3076.   {
  3077. + #ifdef FILE_NAME_NONDIRECTORY
  3078. +   char *na = FILE_NAME_NONDIRECTORY (input_name);
  3079. + #else
  3080.     int len = strlen (input_name);
  3081.     char *na = input_name + len;
  3082. ***************
  3083. *** 1977,1980 ****
  3084. --- 1982,1986 ----
  3085.         na--;
  3086.       }
  3087. + #endif
  3088.   
  3089.   #ifdef ASM_OUTPUT_MAIN_SOURCE_FILENAME
  3090. ***************
  3091. *** 3948,3952 ****
  3092.     compile_file (filename);
  3093.   
  3094. ! #if !defined(OS2) && !defined(VMS) && !defined(WINNT)
  3095.     if (flag_print_mem)
  3096.       {
  3097. --- 3954,3958 ----
  3098.     compile_file (filename);
  3099.   
  3100. ! #if !defined(OS2) && !defined(VMS) && !defined(WINNT) && !defined(amigados)
  3101.     if (flag_print_mem)
  3102.       {
  3103. ***************
  3104. *** 3966,3970 ****
  3105.   #endif /* not USG */
  3106.       }
  3107. ! #endif /* not OS2 and not VMS and not WINNT */
  3108.   
  3109.     if (errorcount)
  3110. --- 3972,3976 ----
  3111.   #endif /* not USG */
  3112.       }
  3113. ! #endif /* not OS2 and not VMS and not WINNT and not amigados*/
  3114.   
  3115.     if (errorcount)
  3116.